This package contains the hardware interface based on unitree_sdk2 to control the Unitree robot in Mujoco simulator or real Unitree Robots supported by sdk2.
For quadruped robot simulation, please use mujoco simulation in unitree_mujoco. In this simulation, I add foot force sensor support.
- command:
- joint position
- joint velocity
- joint effort
- KP
- KD
- state:
- joint effort
- joint position
- joint velocity
- imu sensor
- linear acceleration
- angular velocity
- orientation
- foot force sensor
Tested environment:
- Ubuntu 24.04 ROS2 Jazzy
cd ~/ros2_ws
colcon build --packages-up-to unitree_ros2_control --symlink-installSince the real unitree robot has different network and domain name, you need to set the network and domain name in the
xacro file. Complete ROS2-Control xacro could be found at Unitree G1 Description.
<hardware>
<plugin>hardware_unitree_sdk2/HardwareUnitree</plugin>
<param name="domain">1</param>
<param name="network_interface">lo</param>
</hardware>- Unitree Mujoco
source ~/ros2_ws/install/setup.bash ros2 launch ocs2_arm_controller demo.launch.py robot:=unitree_g1 hardware:=unitree_sim
- Real Unitree G1
source ~/ros2_ws/install/setup.bash ros2 launch ocs2_arm_controller demo.launch.py robot:=unitree_g1 type:=revo2 hardware:=unitree_real