[Unitree Go2] Edu Unable to access the robot through ros2

Hey I am trying to setup dev environment on my Go2 Edu. I’m working directly on the Jetson Orin mounted on the Go2. I followed the ros2 installation provided in GitHub - unitreerobotics/unitree_ros2. However I am not able to access the ros2 topics of the robot. Steps 1, 2 and 3 of Install Unitree ROS2 package successfully executed.

Proceeding further to Connect to Unitree robot section, I believe the setup.sh should have ‘lo’ as the interface because I am directly working on the Go2.

This is what my ifconfig looks like.

unitree@ubuntu:~$ ifconfig 
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:20:e0:5d:fa  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.xx.xx.xx  netmask 255.255.0.0  broadcast 10.66.255.255
        inet6 fe80::d150:4901:5a1a:cb5  prefixlen 64  scopeid 0x20<link>
        ether 3c:6d:66:11:83:65  txqueuelen 1000  (Ethernet)
        RX packets 27375  bytes 20016108 (20.0 MB)
        RX errors 0  dropped 5  overruns 0  frame 0
        TX packets 13287  bytes 1739144 (1.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 8161  bytes 604738 (604.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8161  bytes 604738 (604.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rndis0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 1a:da:05:a7:b3:ed  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 1a:da:05:a7:b3:ef  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

THis is what setup.sh is

#!/bin/bash
echo "Setup unitree ros2 environment"
source /opt/ros/foxy/setup.bash
source $HOME/unitree_ros2/cyclonedds_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
                            <NetworkInterface name="lo" priority="default" multicast="default" />
                        </Interfaces></General></Domain></CycloneDDS>'

I tried all of the interfaces but None of them are providing any output on ros2 topic list.

This is all I can get.

unitree@ubuntu:~$ source ~/unitree_ros2/setup.sh
Setup unitree ros2 environment
unitree@ubuntu:~$ ros2 topic list
/parameter_events
/rosout
unitree@ubuntu:~$ ros2 launch go2_viz view_robot.launch.py
Package 'go2_viz' not found: "package 'go2_viz' not found, searching: ['/home/unitree/unitree_ros2/cyclonedds_ws/install/unitree_api', '/home/unitree/unitree_ros2/cyclonedds_ws/install/rmw_cyclonedds_cpp', '/home/unitree/cyclonedds_ws/install/rmw_cyclonedds_cpp', '/opt/ros/foxy']"

Please help on how to proceed.
Thank you

Dear @yeshwanth,

The onboard pc of the Unitree go2 requires no setup. All the topics are published by default.

This for your own PC connected to the orin.

Revert all the changes and power cycle the robot. Then just do ros2 topic list and it should show up.

Thank you! I tried that but now ros2 topic list hangs. What am I missing?

I tried source /opt/ros/foxy/setup.bash as well but it still hangs.

okay I got an output after restarting in AI mode. However when I try to print any state for example ros2 topic echo /lowstate it gives an error of ModuleNotFoundError: No module named 'unitree_go'. Please help

For this you need to clone unitrees repository and build their sdk as well as ros2 sdk.

Can you please share if there is a doc that I can follow for this? I see a bunch of repositories. Not sure which one I should build. Thank you.

For interfacing with the unitree repository, please follow the Unitree Docs for Go2.

I did setup ROS unitree work space as mentioned in the unitree docs in my computer connected it through the LAN when I ran the setup it didn’t give me any error at the same time but i am not able to see any topic getting publishing in my computer any advice

Hi,

The topic won’t show up unless you follow the setup for the external PC exactly in the docs i.e. unsource ros2 foxy/humble workspace → then build the custom cyclonedds of unitree go2 → source the workspace in which the cyclone dds was built → then source ros2 foxy/humble workspace. Now the topics should be visible in your PC provided you connected via LAN.

Thank you for responding I followed evrything still I’m not able to see any topics being published can you help me in debug I’m not getting any errors I’m using humble.


Do you have the qre_go2 repository if so follow the instructions. If you don’t just send your GitHub ID with the mybotshop order number of the Go2 and we will add you to it.

First Time Setup

Important: Make sure the command source /opt/ros/foxy/setup.bash has not been activated

  • Install Dependencies

./go2_install.bash

  • Make folder called ros2_ws in home directory and clone foxy branch of qre_go2 into it
  • Then build Cyclone in the ros2_ws via.

colcon build --packages-select cyclonedds

  • Source the work

source install/setup.bash

  • Now source ros foxy distro via

source /opt/ros/foxy/setup.bash

  • Next build the repository twice

colcon build --symlink-install

  • Source the built ros workspace via:

source /home/$USER/ros2_ws/install/setup.bash

  • Connect to 123 network with static ip via ubuntu settings (No DHCP, as it disrupts the network)

Note down the network interface

  • Edit and source go2_bringup/config/setup.bash with the corrected network interface e.g.
  • Then source the special configuration for the GO2

source /home/$USER/ros2_ws/src/go2_bringup/setup.bash

  • Now if you are connected via LAN to the GO2 and you do ros2 topic list, the topics should be visible.