This repository contains a simulation environment for the Unitree GO1 robot in Gazebo 11 and ROS 2, along with an interface for navigation. The functionality has been tested with ROS Humble on Ubuntu 22.04
- lcm (Needs to be built from source, instructions here)
- navigation2
- ros2_control
- ros2_controllers
- gazebo_plugins
The repository contains the following ROS 2 packages:
-
go1_sim
:go1_description
: Contains required xacro and config files to load the robot in simulation. Modified from here.go1_gazebo
: Contains the gazebo world and required launch files to initialize the simulation.go1_navigation
: Contains scripts, launch and configuration files for interfacing with a navigation stack.
-
ros2_unitree_legged_controller
: Contains the implementation of unitree's control plugin in ROS 2. This has been ported from the ROS 1 plugin available here. -
ros2_unitree_legged_msgs
: Contains unitree custom messages for interfacing, source here. -
unitree_guide2
: Provides an interface between the navigation and control framework along with a state machine for different control modes. This has been ported to ROS 2 from here.
After placing all the packages in a ROS 2 workspace and building it successfully, run the following in order:
-
(window 1)
ros2 launch go1_gazebo spawn_go1.launch.py
: This will load the simulation and initialize controllers. -
(window 2)
ros2 run unitree_guide2 junior_ctrl
: This activates the interface and state machine. Run this once the last controller plugin (RL_calf_controller) has loaded successfully- Press 2 to switch the robot to standing mode (fixed_stand)
- Press 5 to switch to move_base mode (robot accepts velocity commands in this mode)
Velocity control interface: The robot simulation is configured to navigate as per velocity commands received on the interface topic.
- Topic:
/cmd_vel
- Message type: geometry_msgs/Twist
Odometry data: Odometry data from the ground truth plugin
- Topic:
/odom
- Message type: nav_msgs/Odometry
2D LiDAR data: 2D lidar data from the gazebo sensor plugin
- Topic:
/scan
- Message type: sensor_msgs/LaserScan
Transforms:
Transforms odom
-> base_link
and base_link
-> base_footprint
are provided
- Topic:
/tf
- Message type: tf2_msgs/TFMessage