Skip to content

Commit

Permalink
Merge pull request #33 from abizovnuralem/multi_robot_support
Browse files Browse the repository at this point in the history
Multi robot support
  • Loading branch information
abizovnuralem authored Jun 7, 2024
2 parents f1018b8 + 6c447ce commit 789ab6c
Show file tree
Hide file tree
Showing 39 changed files with 2,442 additions and 810 deletions.
118 changes: 48 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
![Ros2 SDK](https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/49edebbe-11b6-49c6-b82d-bc46257674bd)

# Welcome to the Unitree Go2 ROS2 SDK Project!

![ROS2 CI](https://github.com/abizovnuralem/go2_ros2_sdk/actions/workflows/ros_build.yaml/badge.svg)
[![IsaacSim](https://img.shields.io/badge/IsaacSim-4.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html)
[![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html)
[![Linux platform](https://img.shields.io/badge/platform-linux--64-orange.svg)](https://releases.ubuntu.com/22.04/)
[![Windows platform](https://img.shields.io/badge/platform-windows--64-orange.svg)](https://www.microsoft.com/en-us/)
![ROS2 Build](https://github.com/abizovnuralem/go2_ros2_sdk/actions/workflows/ros_build.yaml/badge.svg)
[![License](https://img.shields.io/badge/license-BSD--2-yellow.svg)](https://opensource.org/licenses/BSD-2-Clause)

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.
We are happy to present you our integration of the Unitree Go2 with ROS2 over Wi-Fi, that was designed by the talented [@tfoldi](https://github.com/tfoldi). You can explore his groundbreaking work at [go2-webrtc](https://github.com/tfoldi/go2-webrtc).

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.
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:
Expand All @@ -17,14 +25,17 @@ This resourceful project is here to empower your Unitree GO2 AIR/PRO/EDU robots
9. Camera stream :white_check_mark:
10. Foxglove bridge :white_check_mark:
11. Laser Scan :white_check_mark:
12. SLAM (slam_toolbox) :white_check_mark:
13. Navigation (nav2) :white_check_mark:
14. Object detection
15. AutoPilot
12. Multi robot support :white_check_mark:
13. WebRTC and CycloneDDS support :white_check_mark:
14. Creating a PointCloud map and store it
15. SLAM (slam_toolbox) (in the current version is not working, need to fix params)
16. Navigation (nav2) (in the current version is not working, need to fix params)
17. Object detection
18. 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 on our GitHub repository.
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!

Expand All @@ -36,35 +47,21 @@ Together, let's push the boundaries of what's possible with the Unitree Go2 and

:robot: Compatible with AIR, PRO, and EDU variants

:footprints: Access to foot force sensors feedback (available on GO2 PRO/EDU)
:footprints: Access to foot force sensors feedback (available on some GO2 PRO models or EDU)


Real time Go2 Air/PRO/EDU joints sync:
## Real time Go2 Air/PRO/EDU joints sync:

<p align="center">
<img width="1280" height="640" src="https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/bf3f5a83-f02b-4c78-a7a1-b379ce057492" alt='Go2 joints sync'>
</p>

Go2 Air/PRO/EDU lidar point cloud:

<p align="center">
<img width="1280" height="640" src="https://github.com/abizovnuralem/go2_ros2_sdk/blob/master/go2_lidar_3.gif?raw=true" alt='Go2 point cloud'>
</p>
## Go2 Air/PRO/EDU lidar point cloud:

<p align="center">
<img width="1280" height="640" src="https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/9c1c3826-f875-4da1-a650-747044e748e1" alt='Go2 point cloud'>
</p>

## Topic
Real time Go2 Air/PRO ROS2 topics

<p align="left">
<img width="731" height="383" src="https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/4d36c2c0-bd21-4af7-925e-b8fd6db68e61" alt='Go2 topic list'>
</p>

<p align="left">
<img width="446" height="1045" src="https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/671af655-877b-4f36-89d3-91730674526d" alt='Go2 topic list'>
</p>

## System requirements
Tested systems and ROS2 distro
Expand All @@ -74,41 +71,18 @@ Tested systems and ROS2 distro
|Ubuntu 22.04|humble|![ROS2 CI](https://github.com/abizovnuralem/go2_ros2_sdk/actions/workflows/ros_build.yaml/badge.svg)
|Ubuntu 22.04|rolling|![ROS2 CI](https://github.com/abizovnuralem/go2_ros2_sdk/actions/workflows/ros_build.yaml/badge.svg)

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
## Installation

```
mkdir -p ros2_ws/src
cd ros2_ws/src
git clone --recurse-submodules https://github.com/abizovnuralem/go2_ros2_sdk.git
cd go2_ros2_sdk
cp -a go2_ros2_sdk/. .
rm -r -f 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

Expand All @@ -126,21 +100,37 @@ 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
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))

```
export ROBOT_IP="Your robot ip"
cd ros2_ws
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

<p align="center">
Expand All @@ -154,13 +144,7 @@ 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

<p align="center">
<img width="1280" height="640" src="https://github.com/abizovnuralem/go2_ros2_sdk/assets/33475993/59f33599-a54c-4cff-8ac2-6859a05ccb8a" alt='Slam'>
</p>

## WSL 2

Expand Down Expand Up @@ -198,21 +182,15 @@ If you are running ROS2 under WSL2 - you may need to configure Joystick\Gamepad
Run `ros2 run joy joy_enumerate_devices`
You should see something like this
```
ID : GUID : GamePad : Mapped : Joystick Device Name
-------------------------------------------------------------------------------
0 : 030000005e040000120b000007050000 : true : false : Xbox Series X Controller
```
## 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!
Special thanks to @tfoldi, @legion1581, @budavariam, @alex.lin and TheRoboVerse community!
## License
Expand Down
159 changes: 0 additions & 159 deletions foxglove.json

This file was deleted.

Binary file removed go2_lidar_3.gif
Binary file not shown.
Loading

0 comments on commit 789ab6c

Please sign in to comment.