This repository contains the ros2-control based controllers for the quadruped robot.
- Controllers: contains the ros2-control controllers
- Commands: contains command node used to send command to the controller
- Descriptions: contains the urdf model of the robot
- Hardwares: contains the ros2-control hardware interface for the robot
Todo List:
- Mujoco Simulation
- Unitree Guide Controller
- Gazebo Simulation
- Leg PD Controller
- Contact Sensor Simulation
- OCS2 Quadruped Control
- Learning-based Controller
- Fully understand the RL Workflow
- ROS2 Humble Gazebo Classic Support
Video for Unitree Guide Controller:
Video for OCS2 Quadruped Controller:
Video for RL Quadruped Controller:
- rosdep
cd ~/ros2_ws rosdep install --from-paths src --ignore-src -r -y
- Compile the package
colcon build --packages-up-to unitree_guide_controller go2_description keyboard_input
Please use C++ Simulation in this Mujoco Simulation for more robot models and contact sensor.
Warning: CycloneDDS ROS2 RMW may conflict with unitree_sdk2. If you cannot launch unitree mujoco simulation without
sudo
, then you cannot usedunitree_mujoco_hardware
. This conflict could be solved by one of below two methods:
- Uninstall CycloneDDS ROS2 RMW, or
- Follow the guide in unitree_ros2 to configure the ROS2 RMW by compiling cyclone dds.
- Compile Unitree Hardware Interfaces
cd ~/ros2_ws colcon build --packages-up-to hardware_unitree_mujoco
- Launch the unitree mujoco go2 simulation
- Launch the ros2-control
source ~/ros2_ws/install/setup.bash ros2 launch unitree_guide_controller mujoco.launch.py
- Run the keyboard control node
source ~/ros2_ws/install/setup.bash ros2 run keyboard_input keyboard_input
- Install Gazebo Classic
sudo apt-get install ros-humble-gazebo-ros ros-humble-gazebo-ros2-control
- Compile Leg PD Controller
colcon build --packages-up-to leg_pd_controller
- Launch the ros2-control
source ~/ros2_ws/install/setup.bash ros2 launch unitree_guide_controller gazebo_classic.launch.py
- Run the keyboard control node
source ~/ros2_ws/install/setup.bash ros2 run keyboard_input keyboard_input
-
Install Gazebo
sudo apt-get install ros-jazzy-ros-gz ros-jazzy-gz-ros2-control
-
Compile Leg PD Controller
colcon build --packages-up-to leg_pd_controller
-
Launch the ros2-control
source ~/ros2_ws/install/setup.bash ros2 launch unitree_guide_controller gazebo.launch.py
-
Run the keyboard control node
source ~/ros2_ws/install/setup.bash ros2 run keyboard_input keyboard_input
For more details, please refer to the unitree guide controller and go2 description.
[1] Liao, Qiayuan, et al. "Walking in narrow spaces: Safety-critical locomotion control for quadrupedal robots with duality-based optimization." In 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 2723-2730. IEEE, 2023.
[1] Unitree Robotics. unitree_guide: An open source project for controlling the quadruped robot of Unitree Robotics, and it is also the software project accompanying 《四足机器人控制算法--建模、控制与实践》 published by Unitree Robotics. [Online]. Available: https://github.com/unitreerobotics/unitree_guide
[2] Qiayuan Liao. legged_control: An open-source NMPC, WBC, state estimation, and sim2real framework for legged robots. [Online]. Available: https://github.com/qiayuanl/legged_control
[3] Ziqi Fan. rl_sar: Simulation Verification and Physical Deployment of Robot Reinforcement Learning Algorithm. 2024. Available: https://github.com/fan-ziqi/rl_sar