Installation

Prerequisites

The legged_control2 library is written in C++. It is tested under Ubuntu 24.04 with library versions as provided in the package sources.

Source code

The source code is hosted on GitHub: qiayuanl/legged_control2.

# Clone legged_control2
git clone git@github.com:qiayuanl/legged_control2.git

Installation

Docker

For Ubuntu 18.04, 20.04 and 24.04 users, especially for Unitree on-board computers, you should use Docker.

We have pre-built Docker images for different specific robots. You can pull the image from Docker Hub. For more details, please refer to the TODO.

Upgrading

To upgrade the legged_control2 and all its dependencies to the latest version:

sudo apt-get update
sudo apt install --only-upgrade 'ros-jazzy-*'

Note

It is important to upgrade all ros-jazzy-* packages together. Upgrading only individual packages (e.g., ros-jazzy-legged-control-base) may leave their dependencies at old versions, causing ABI/API incompatibilities.

Don’t forget to rebuild your colcon workspace after upgrading.

Build from Source

For Ubuntu 24.04 users, you can build from source.

  • Create a new colcon workspace:

    mkdir -p ~/colcon_ws/src && cd ~/colcon_ws/src
    
  • Clone the source code:

    git clone git@github.com:qiayuanl/legged_control2.git && cd ..
    
  • Install dependencies:

    rosdep install --from-paths src --ignore-src -r -y
    
  • Build the workspace:

    colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelwithDebInfo --packages-up-to legged_controllers