ROS 2 on Unitree robots works without reverse engineering and without translation nodes: the robot publishes its data on DDS (CycloneDDS), and ROS 2 uses DDS as its communication layer. The official unitree_ros2 package provides the message definitions and the configuration scripts. The steps below follow the official README.
Which Unitree robots support ROS 2
Software development is only supported on the developer versions. For the Go2, the official page lists SDK access for your own software development on the EDU version, not on Air and Pro; the same applies to the G1 with the G1 EDU.
| Robot | Messages in unitree_ros2 | ROS 2 examples in the repository |
|---|---|---|
| Go2 EDU | unitree_go | sport client, stand, robot state, low level |
| B2 / B2W | unitree_go | sport client, stand |
| G1 EDU | unitree_hg | g1_low_level_example |
| H2 | unitree_hg | h2_loco_client (high level), h2_ankle_swing_example (low level) |
| H1 / H1-2 | unitree_go / unitree_hg | H1-2 low level |
For R1 and A2, in October 2026 unitree_sdk2 contains dedicated C++ examples, but unitree_ros2 does not yet have specific examples. Before buying for a ROS 2-only project on these models, check the state of the repository.
What you need
- a robot in the EDU version (Go2 EDU, G1 EDU, B2, H2);
- a PC with Ubuntu 22.04 and ROS 2 Humble, the combination recommended by Unitree (install ROS 2 Humble with the official guide);
- an Ethernet cable between the PC and the robot.
Install unitree_ros2
1. Download the repository and install the dependencies:
git clone https://github.com/unitreerobotics/unitree_ros2
sudo apt install ros-humble-rmw-cyclonedds-cpp ros-humble-rosidl-generator-dds-idl libyaml-cpp-dev
2. Build the message packages:
cd ~/unitree_ros2/cyclonedds_ws
source /opt/ros/humble/setup.bash
colcon build
Network and CycloneDDS
Connect the PC to the robot with an Ethernet cable. In the interface settings, set manual IPv4, address 192.168.123.99, mask 255.255.255.0, as the README says. With ifconfig or ip a find the interface name (for example enp3s0) and enter it in ~/unitree_ros2/setup.sh:
#!/bin/bash
source /opt/ros/humble/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="enp3s0" priority="default" multicast="default" />
</Interfaces></General></Domain></CycloneDDS>'
The key line is RMW_IMPLEMENTATION=rmw_cyclonedds_cpp: the default middleware in Humble is a different one, and without this variable the PC does not see the robot. The ROS 2 documentation explains how to choose the DDS middleware. Without a robot connected you can use setup_local.sh, which works on the loopback interface.
First topic
source ~/unitree_ros2/setup.sh
ros2 topic list
ros2 topic echo /sportmodestate
On Go2 and B2, /sportmodestate reports position, velocity and gait; /lowstate reports motors, IMU and battery. To build and run the examples:
cd ~/unitree_ros2/example
colcon build
./install/unitree_ros2_example/bin/read_motion_state
The README also shows how to display the Go2 LiDAR point cloud in RViz2, on the topic utlidar/cloud with frame utlidar_lidar.
Control: high level and low level
- High level (Go2, B2): requests on
/api/sport/requestwithunitree_apimessages, generated by theSportClientclass in the examples. The robot uses its own motion control. - Low level: position, velocity, torque and gain commands on
/lowcmd. First you must disable the built-in motion service, otherwise the commands overlap. On humanoids you enter debug mode with L2+R2, with the robot hanging: the full procedure is in the guide programming the G1.
Simulate before the hardware
unitree_mujoco is the official simulator based on MuJoCo: it accepts programs written with unitree_sdk2, unitree_sdk2_python and unitree_ros2, with the same low-level messages as the real robot. You develop in simulation on the loopback interface, then the same code runs on the robot by changing only the network interface. For locomotion policies there is unitree_rl_gym (Go2, G1, H1, H1-2).
Common errors
- No topics: RMW not set, wrong interface in
setup.shor PC outside the subnet. The README also recommends restarting the PC after the first setup. - Several ROS installations on the same PC: avoid putting
setup.shin~/.bashrcand load it by hand when needed.
For university labs, Abra Robotics, part of the Unitree Italia distribution chain, supplies the EDU models and offers training and SDK development as separate services: see University and Research and Software.
Frequently asked questions
Which ROS 2 version should I use with Unitree robots?
Humble on Ubuntu 22.04: it is the combination recommended by Unitree.
Can I use the Go2 Air or Pro with ROS 2?
No. The SDK, and therefore ROS 2, is only supported on the Go2 EDU.
Do I need to install a bridge between the SDK and ROS 2?
No. The robot and ROS 2 both speak DDS: with unitree_ros2 and CycloneDDS the robot's messages are already ROS 2 topics.
Why does ros2 topic list not show the robot's topics?
Usually RMW_IMPLEMENTATION=rmw_cyclonedds_cpp is missing, the interface in setup.sh is wrong or the PC is not on the 192.168.123.x subnet. A ping to the robot settles the third case.
Can I use ROS 2 without the robot connected?
Yes, with setup_local.sh on the loopback interface and with the unitree_mujoco simulator, which uses the same messages as the robot.
Sources
- Unitree, unitree_ros2, README and examples: github.com/unitreerobotics/unitree_ros2
- Unitree, unitree_sdk2: github.com/unitreerobotics/unitree_sdk2
- Unitree, unitree_mujoco: github.com/unitreerobotics/unitree_mujoco
- Unitree, unitree_rl_gym: github.com/unitreerobotics/unitree_rl_gym
- Unitree, Go2 and G1 product pages (SDK only on EDU versions): unitree.com/go2 · unitree.com/g1
- Unitree Document Center, developer section: support.unitree.com/home/en/developer
- ROS 2 Documentation, distributions and end-of-support dates: docs.ros.org/en/humble/Releases.html
- ROS 2 Documentation, Humble installation from Debian packages: docs.ros.org
- ROS 2 Documentation, DDS middleware and RMW: docs.ros.org


