This project provides an architecture and many key algorithms to control quadruped robots, including state estimation, gait generation, stance and swing leg controllers.
The project now supports A1 robot (Unitree-Robotics) and Lite2A robot (Deep-Robotics). This project can be easily extended to support other quadruped robots such as AlienGO/GO1 (Unitree-Robotics), Jueying/X20(Deep-Robotics) and Anymal. For more information about quadruped robots, check out the following websites
Here are some snapshots in simulation and in real environments
Here is a demo for a real quadruped robot (Unitree A1).
The source code includes five major directories
- demo has many demo examples to help users understand the software usage and the project architecture itself.
- extern contains the third-party dependencies to successfully compile and run the code.
- navigation contains the codes for SLAM and navigation.
- quadruped contains the core modules defining robots, state, planner, dynamics and supporting algorithms.
- simulation contains the configuration to run demos in simulation.
You need install ROS (Robot Operating System) first. We tested the codes under Ubuntu Linux and ROS 1 Melodic Morenia distribution. Other newer ROS distributions are supposed to be supported. Please visit http://www.wiki.ros.org for ROS installation.
cd ${your_workspace}
mkdir src
cd ${your_workspace}/src
catkin_init_workspace
git clone https://github.com/TopHillRobotics/quadruped-robot/
- yaml-cpp
- eigen3
- lcm
- glm
sudo apt install libyaml-cpp-dev
sudo apt install libeigen3-dev
sudo apt install liblcm-dev
sudo apt install libglm-dev
cd ${your_workspace}
catkin_make
For a smooth compilation, we suggest using CMake version 3.15 or greater.
Browse the directories src/demo/${demo_xxx_xxx}
to find many demo examples. The demo can either run in a Gazebo simulator or in a real environment. We support the robots provided by two companies: unitree-robotics and deep-robotics.
Our locomotion controllers support two modes: velocity control and position control. Please check out the corresponding demos for the usage.
First, in one terminal, source setup.bash
to set up the development environment
source ${your_workspace}/devel/setup.bash
Second, run the Gazebo simulator and load a robot.
roslaunch unitree_gazebo normal.launch rname:=a1 use_xacro:=true
In this command, rname specifies the robot you use and use_xacro indicates if you use URDF or XACRO description file.
Third, in a new terminal, launch a demo and run the quadruped controller node. Here, a demo helloworld lets the quadruped robot stand up.
rosrun demo demo_helloworld sim
Here, sim
indicates that the demo is running in simulation. For more demo examples, please check out the directory /demos. If you have a robot YAML configuration file such as XACRO or URDF, you can specify the file location to initialize a qrRobotSim class.
You can run a demo for a real quadruped robot either using your own external computer or a built-in miniPC (refer to A1 or Lite2A user manual). If you want to control the robot using your own computer, you need to connect your computer directly to the real quarduped robot with either an Ethernet cable or WiFi. This network connection allows a robot to exchange messages between your computer and the quarduped. Please check out the A1 or Lite2A user manual for how to build a connection. Some details are given bellow to explain running a demo for a real quadruped robot.
First, in one terminal, source the setup.bash
to set up the development environment
source ${your_workspace}/devel/setup.bash
Second, run roscore
to start ROS since a real robot use LCM and ROS for communication. Please open a new terminal to run this command
roscore
Third, in a new terminal, launch a demo for a real quadruped, and run the quadruped controller node. The demo helloworld lets the quadruped robot stand up.
rosrun demo demo_helloworld real
Here, real
indicates that the demo is running in a real environment using a real quadruped robot. Given a robot YAML configuration file such as XACRO or URDF, a qrRobotReal object is constructed.
Please file bugs and feature requests here: https://github.com/TopHillRobotics/quadruped-robot/issues
You can help to ensure your issue gets fixed if you provide sufficient detail.
Read a readthedocs for the helps, tutorials, demo explanation.