/go2_ros2_sdk

Unofficial ROS2 SDK support for Unitree GO2 AIR/PRO/EDU

Primary LanguagePythonBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Welcome to the Unitree Go2 ROS2 SDK Project!

ROS2 CI

We are delighted to present you with our integration of the Unitree Go2 ROS2 SDK, leveraging the innovative go2-WebRTC interface, originally designed by the talented @tfoldi. You can explore and utilize his groundbreaking work at go2-webrtc on GitHub.

This resourceful project is here to empower your Unitree GO2 AIR/PRO/EDU robots with ROS2 SDK capabilities. We're thrilled to offer an enhanced level of control and interaction, enabling you to take your robotics projects to new heights.

Project RoadMap:

  1. URDF ✅
  2. Joint states sync in real time ✅
  3. IMU sync in real time ✅
  4. Joystick control in real time ✅
  5. Go2 topics info in real time ✅
  6. Foot force sensors info in real time ✅
  7. Lidar stream (added pointCloud2) ✅
  8. Camera stream ✅
  9. Foxglove bridge ✅
  10. Laser Scan ✅
  11. SLAM (slam_toolbox) ✅
  12. Navigation (nav2) ✅
  13. Object detection
  14. 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 on our GitHub repository.

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:

✨ Full ROS2 SDK support for your Unitree GO2

🤖 Compatible with AIR, PRO, and EDU variants

👣 Access to foot force sensors feedback (available on GO2 PRO/EDU)

Real time Go2 Air/PRO/EDU joints sync:

Go2 joints sync

Go2 Air/PRO/EDU lidar point cloud:

Go2 point cloud

Go2 point cloud

Topic

Real time Go2 Air/PRO ROS2 topics

Go2 topic list

Go2 topic list

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

A single workspace can contain as many packages as you want, each in their own folder. You can also have packages of different build types in one workspace (CMake, Python, etc.). You cannot have nested packages.

Best practice is to have a src folder within your workspace, and to create your packages in there. This keeps the top level of the workspace “clean”.

Your workspace should look like:

workspace_folder/
    src/
      py_package_1/
          package.xml
          resource/py_package_1
          setup.cfg
          setup.py
          py_package_1/

      py_package_2/
          package.xml
          resource/py_package_2
          setup.cfg
          setup.py
          py_package_2/

clone this repo to src folder of your own ros2_ws repo

git clone --recurse-submodules https://github.com/abizovnuralem/go2_ros2_sdk.git

cd go2_ros2_sdk
sudo apt install python3-pip clang
pip install -r requirements.txt
cd ..
mkdir -p ros2_ws/src
copy all files inside go2_ros2_sdk folder to ros2_ws/src folder

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
cd ros2_ws
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 then

export ROBOT_IP="Your robot ip"
cd ros2_ws
source install/setup.bash
ros2 launch go2_robot_sdk robot.launch.py

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".
  3. (Optional) You can also import a default layout view from the foxglove.json file located inside this repository.

SLAM

Slam

Development

To contribute or modify the project, refer to these resources for implementing additional features or improving the existing codebase. PRs are welcome!

Thanks

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

License

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