MCPcopy Index your code
hub / github.com/abizovnuralem/go2_ros2_sdk

github.com/abizovnuralem/go2_ros2_sdk @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
71 symbols 227 edges 14 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Ros2 SDK

Welcome to the Unitree Go2 ROS2 SDK Project!

IsaacSim Python Linux platform Windows platform ROS2 Build License

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.

Project RoadMap:

  1. URDF :white_check_mark:
  2. Joint states sync in real time :white_check_mark:
  3. IMU sync in real time :white_check_mark:
  4. Joystick control in real time :white_check_mark:
  5. Go2 topics info in real time :white_check_mark:
  6. Foot force sensors info in real time :white_check_mark:
  7. Lidar stream (added pointCloud2) :white_check_mark:
  8. Camera stream :white_check_mark:
  9. Foxglove bridge :white_check_mark:
  10. Laser Scan :white_check_mark:
  11. Multi robot support :white_check_mark:
  12. WebRTC and CycloneDDS support :white_check_mark:
  13. Creating a PointCloud map and store it
  14. SLAM (slam_toolbox) (in the current version is not working, need to fix params)
  15. Navigation (nav2) (in the current version is not working, need to fix params)
  16. Object detection
  17. AutoPilot

Your feedback and support mean the world to us.

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!

Exciting Features:

: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)

Real time Go2 Air/PRO/EDU joints sync:

Go2 joints sync

Go2 Air/PRO/EDU lidar point cloud:

Go2 point cloud

System requirements

Tested systems and ROS2 distro |systems|ROS2 distro|Build status |--|--|--| |Ubuntu 22.04|iron|ROS2 CI |Ubuntu 22.04|humble|ROS2 CI |Ubuntu 22.04|rolling|ROS2 CI

Installation

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

Usage

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

Multi robot support

If you want to connect several robots for collaboration:

export ROBOT_IP="robot_ip_1, robot_ip_2, robot_ip_N"

Switching between webrtc connection (Wi-Fi) to CycloneDDS (Ethernet)

export CONN_TYPE="webrtc"

or

export CONN_TYPE="cyclonedds"

Foxglove

Foxglove bridge

To use Foxglove, you need to install Foxglove Studio:

sudo snap install foxglove-studio
  1. Open Foxglove Studio and press "Open Connection".
  2. In the "Open Connection" settings, choose "Foxglove WebSocket" and use the default configuration ws://localhost:8765, then press "Open".

WSL 2

If you are running ROS2 under WSL2 - you may need to configure Joystick\Gamepad to navigate the robot.

  1. 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

  2. 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

  3. 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

  4. 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 ```

Thanks

Special thanks to @tfoldi, @legion1581, @budavariam, @alex.lin and TheRoboVerse community!

License

This project is licensed under the BSD 2-clause License - see the LICENSE file for details.

Core symbols most depended-on inside this repo

Shape

Method 51
Function 14
Class 6

Languages

Python100%

Modules by API surface

go2_robot_sdk/go2_robot_sdk/go2_driver_node.py22 symbols
go2_robot_sdk/scripts/webrtc_driver.py15 symbols
go2_robot_sdk/scripts/go2_math.py14 symbols
go2_robot_sdk/scripts/go2_lidar_decoder.py9 symbols
go2_robot_sdk/scripts/go2_proc_text.py4 symbols
go2_robot_sdk/scripts/go2_func.py3 symbols
go2_robot_sdk/test/test_pep257.py1 symbols
go2_robot_sdk/test/test_flake8.py1 symbols
go2_robot_sdk/test/test_copyright.py1 symbols
go2_robot_sdk/launch/robot.launch.py1 symbols

For agents

$ claude mcp add go2_ros2_sdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page