Skip to content

UniflexAI/unitree-go2-ros2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unitree Go2 ROS 2 - CHAMP Controller

ROS 2 Humble package for the Unitree Go2 quadruped robot using the CHAMP controller framework with Ignition Fortress (Gazebo) simulation. Features teleoperation, 3D LiDAR (Velodyne), IMU, and 2D LiDAR support.

Unitree Go2:

Unitree Robotics is focusing on the R&D, production, and sales of consumer and industry-class high-performance general-purpose legged and humanoid robots, six-axis manipulators, and so on. They attach great importance to independent research and development and technological innovation, fully self-researching key core robot components such as motors, reducers, controllers, LIDAR and high-performance perception and motion control algorithms, integrating the entire robotics industry chain.

CHAMP Controller:

champ

CHAMP is an open source development framework for building new quadrupedal robots and developing new control algorithms. The control framework is based on "Hierarchical controller for highly dynamic locomotion utilizing pattern modulation and impedance control : implementation on the MIT Cheetah robot".

Resources:

Tested on:

  • Ubuntu 22.04 (ROS 2 Humble)
  • Ignition Fortress (Gazebo)

Features:

  • ✅ Go2 robot configured with CHAMP controller
  • ✅ Robot description ported to ROS 2
    • ✅ URDF with ros2_control tags
    • ✅ Launch files for ROS 2
    • ✅ Configuration files for ROS 2
  • ✅ Ignition Fortress simulation
  • ✅ RViz visualization
  • ✅ Teleoperation support
  • ✅ IMU sensor
  • ✅ 2D LiDAR (Hokuyo)
  • ✅ 3D LiDAR (Velodyne VLP-16)
  • ⬜ SLAM integration
  • ⬜ Nav2 integration

1. Installation

1.0 Clone the repository:

cd <your_ws>/src
git clone https://github.com/rahgirrafi/unitree-go2-ros2.git
cd unitree-go2-ros2

# Initialize and update the velodyne submodule
git submodule update --init --recursive

Note: The velodyne lidar package is included as a git submodule. If you've already cloned the repository without the --recursive flag, run git submodule update --init --recursive to fetch the submodule.

1.1 Build docker image:

./dev/build.sh

./deb/run.sh

1.2 Build your workspace:

cd <your_ws>
colcon build
. <your_ws>/install/setup.bash

2. Quick Start

You don't need a physical robot to run the following demos. All dependencies will be installed via rosdep.

2.1 Basic Simulation

Run the Ignition Fortress simulation:

ros2 launch go2_config gazebo_realsense_d435i.launch.py

Go2 Gazebo Launch

2.2 Simulation with RViz

Run the simulation with RViz visualization:

ros2 launch go2_config gazebo_realsense_d435i.launch.py rviz:=true

Go2 Gazebo RViz Launch

2.3 Teleoperation

Control the robot using keyboard:

ros2 run teleop_twist_keyboard teleop_twist_keyboard

2.4 Velodyne 3D LiDAR Simulation

Run the simulation with Velodyne VLP-16 3D LiDAR:

ros2 launch go2_config gazebo_velodyne.launch.py 

Go2 Velodyne Gazebo Launch

2.5 Velodyne with RViz Point Cloud

Run the Velodyne simulation with RViz to visualize point cloud data:

ros2 launch go2_config gazebo_velodyne.launch.py rviz:=true

Note: Set point cloud topic to /velodyne_points in RViz.

Go2 Velodyne Gazebo RViz Launch

2.6 Hokuyo 2D LiDAR Configuration

To use a 2D laser scanner instead of the 3D Velodyne LiDAR:

  1. Open robots/descriptions/go2_description/xacro/robot_VLP.xacro
  2. Comment out: <xacro:include filename="$(find go2_description)/xacro/velodyne.xacro"/>
  3. Uncomment: <xacro:include filename="$(find go2_description)/xacro/laser.xacro"/>
  4. Rebuild the workspace

Then launch:

ros2 launch go2_config gazebo_velodyne.launch.py rviz:=true

3. Tuning Gait Parameters

The gait configuration for your robot can be found in go2_config/config/gait/gait.yaml.

CHAMP Setup Assistant

Parameter Unit Description
Knee Orientation - How the knees should be bent. Configure as .>> .>< .<< .<> where dot is the front of the robot.
Max Linear Velocity X m/s Robot's maximum forward/reverse speed.
Max Linear Velocity Y m/s Robot's maximum speed when moving sideways.
Max Angular Velocity Z rad/s Robot's maximum rotational speed.
Stance Duration s How long each leg spends on the ground while walking. Default: 0.25s.
Leg Swing Height m Trajectory height during swing phase.
Leg Stance Height m Trajectory depth during stance phase.
Robot Walking Height m Distance from hip to ground while walking. Setting too high can cause instability.
CoM X Translation m Shift reference point in X axis to compensate for uneven weight distribution.
Odometry Scaler - Multiplier for dead reckoning velocities. Typically 1.0 to 1.20.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'feat: Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is open source. See individual package licenses for details.

Acknowledgements

This project builds upon and incorporates work from the following projects:

We are grateful to the developers and contributors of these projects for their valuable work.

Work plan

  • add Gazebo Realsense D435i simulation scaffold
  • keep Ignition Fortress / ros_gz native path
  • avoid taking a hard dependency on Gazebo Classic Realsense plugins for the first iteration

About

Developing robot description model for Unitree Go2 robot configured with Champ Legged Robots Research Repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 60.3%
  • Python 31.6%
  • CMake 3.1%
  • C 2.4%
  • Shell 1.5%
  • Dockerfile 1.1%