We are happy to present you our integration of the Unitree Go2 with ROS2 over Wi-Fi, that was designed by the talented @tfoldi. You can explore his groundbreaking work at go2-webrtc.
This repo will empower your Unitree GO2 AIR/PRO/EDU robots with ROS2 capabilities, using both WebRTC (Wi-Fi) and CycloneDDS (Ethernet) protocols.
If you're as enthusiastic about this project as we are, please consider giving it a :star: star!!!
Your encouragement fuels our passion and helps us develop our RoadMap further. We welcome any help or suggestions you can offer!
Together, let's push the boundaries of what's possible with the Unitree Go2 and ROS2!
:sparkles: Full ROS2 SDK support for your Unitree GO2
:robot: Compatible with AIR, PRO, and EDU variants
:footprints: Access to foot force sensors feedback (available on some GO2 PRO models or EDU)
Tested systems and ROS2 distro
|systems|ROS2 distro|Build status
|--|--|--|
|Ubuntu 22.04|iron|
|Ubuntu 22.04|humble|
|Ubuntu 22.04|rolling|
mkdir -p ros2_ws/src
cd ros2_ws/src
git clone --recurse-submodules https://github.com/abizovnuralem/go2_ros2_sdk.git
cp -a go2_ros2_sdk/. .
rm -r -f go2_ros2_sdk
sudo apt install python3-pip clang
pip install -r requirements.txt
cd ..
install rust language support in your system https://www.rust-lang.org/tools/install
cargo should work in terminal
cargo --version
Build it
You need to install ros2 and rosdep package first.
https://docs.ros.org/en/humble/Installation.html
source /opt/ros/$ROS_DISTRO/setup.bash
rosdep install --from-paths src --ignore-src -r -y
colcon build
don't forget to setup your GO2-robot in Wifi-mode and get IP (You can use mobile app to get it, go to Device -> Data -> Automatic Machine Inspection, (look for STA Network: wlan0))
source install/setup.bash
export ROBOT_IP="robot_ip"
export CONN_TYPE="webrtc"
ros2 launch go2_robot_sdk robot.launch.py
If you want to connect several robots for collaboration:
export ROBOT_IP="robot_ip_1, robot_ip_2, robot_ip_N"
export CONN_TYPE="webrtc"
or
export CONN_TYPE="cyclonedds"
To use Foxglove, you need to install Foxglove Studio:
sudo snap install foxglove-studio
If you are running ROS2 under WSL2 - you may need to configure Joystick\Gamepad to navigate the robot.
Step 1 - share device with WSL2
Follow steps here https://learn.microsoft.com/en-us/windows/wsl/connect-usb to share your console device with WSL2
Step 2 - Enable WSL2 joystick drivers
WSL2 does not come by default with the modules for joysticks. Build WSL2 Kernel with the joystick drivers. Follow the instructions here: https://github.com/dorssel/usbipd-win/wiki/WSL-support#building-your-own-wsl-2-kernel-with-additional-drivers If you're comfortable with WSl2, skip the export steps and start at Install prerequisites.
Before buiding, edit .config file and update the CONFIG_ values listed in this GitHub issue: https://github.com/microsoft/WSL/issues/7747#issuecomment-1328217406
Step 3 - Give permissions to /dev/input devices
Once you've finished the guides under Step 3 - you should be able to see your joystick device under /dev/input
bash
ls /dev/input
by-id by-path event0 js0
By default /dev/input/event* will only have root permissions, so joy node won't have access to the joystick
Create a file /etc/udev/rules.d/99-userdev-input.rules with the following content:
KERNEL=="event*", SUBSYSTEM=="input", RUN+="/usr/bin/setfacl -m u:YOURUSERNAME:rw $env{DEVNAME}"
Run as root: udevadm control --reload-rules && udevadm trigger
https://askubuntu.com/a/609678
Step 3 - verify that joy node is able to see the device properly.
Run ros2 run joy joy_enumerate_devices
``` ID : GUID : GamePad : Mapped : Joystick Device Name
0 : 030000005e040000120b000007050000 : true : false : Xbox Series X Controller ```
Special thanks to @tfoldi, @legion1581, @budavariam, @alex.lin and TheRoboVerse community!
This project is licensed under the BSD 2-clause License - see the LICENSE file for details.
$ claude mcp add go2_ros2_sdk \
-- python -m otcore.mcp_server <graph>