Skip to content

zitongbai/legged_lab

Repository files navigation

Legged Lab

IsaacSim Isaac Lab Python Linux platform Windows platform pre-commit License

Overview

This repository is an extension for legged robot reinforcement learning based on Isaac Lab, which allows to develop in an isolated environment, outside of the core Isaac Lab repository. The RL algorithm is based on a forked RSL-RL library.

Key Features:

  • RL Support vanilla RL for legged robots, including Unitree G1, Go2.
  • AMP Adversarial Motion Priors (AMP) for humanoid robots, including Unitree G1. We suggest retargeting the human motion data by GMR.

Demo

  • Adversarial Motion Priors for Unitree G1:
rl-video-step-0.mp4

News & Updates

  • 2025/08/24: Support using more steps observations and motion data in AMP training.
  • 2025/08/22: Compatible with Isaac Lab 2.2.0.
  • 2025/08/21: Add support for retargeting human motion data by GMR.

Installation

  • Install Isaac Lab by following the installation guide. We recommend using the conda installation as it simplifies calling Python scripts from the terminal.

  • Clone this repository separately from the Isaac Lab installation (i.e. outside the IsaacLab directory):

# Option 1: HTTPS
git clone https://github.com/zitongbai/legged_lab

# Option 2: SSH
git clone [email protected]:zitongbai/legged_lab.git
  • Using a python interpreter that has Isaac Lab installed, install the library
python -m pip install -e source/legged_lab
  • Clone the forked RSL-RL library separately from the Isaac Lab installation and legged_lab repository (i.e. outside the IsaacLab and legged_lab directories):
# Option 1: HTTPS
git clone https://github.com/zitongbai/rsl_rl.git
# Option 2: SSH
git clone [email protected]:zitongbai/rsl_rl.git

cd rsl_rl
git checkout feature/amp
  • Install the forked RSL-RL library:
# in the rsl_rl directory
python -m pip install -e .
  • Download the usd model for Unitree G1:
# in legged lab directory
gdown "https://drive.google.com/drive/folders/1rlhZcurMenq4RGojZVUDl3a6Ja2hm-di?usp=drive_link" --folder -O ./source/legged_lab/legged_lab/data/Robots/
  • Download the motion data for Unitree G1:
# in legged lab directory
gdown "https://drive.google.com/drive/folders/1tXtyjgM_wwqWNwnpn8ny5b4q1c-GxZkm?usp=sharing" --folder -O ./source/legged_lab/legged_lab/data/
  • Verify that the extension is correctly installed by running the following command:
python scripts/rsl_rl/train.py --task=LeggedLab-Isaac-Velocity-Rough-G1-v0 --headless

Train

RL

To train the reinforcement learning for Unitree G1, you can run the following command:

python scripts/rsl_rl/train.py --task=LeggedLab-Isaac-Velocity-Rough-G1-v0 --headless

For more details about the arguments, run python scripts/rsl_rl/train.py -h.

AMP

To train the AMP algorithm, you can run the following command:

python scripts/rsl_rl/train.py --task LeggedLab-Isaac-AMP-Flat-G1-v0 --headless --max_iterations 10000

If you want to train it in a non-default gpu, you can pass more arguments to the command:

# replace `x` with the gpu id you want to use
python scripts/rsl_rl/train.py --task LeggedLab-Isaac-AMP-Flat-G1-v0 --headless --max_iterations 10000 --device cuda:x agent.device=cuda:x

Play

You can play the trained model in a headless mode and record the video:

# replace the checkpoint path with the path to your trained model
python scripts/rsl_rl/play.py --task LeggedLab-Isaac-AMP-Flat-G1-Play-v0 --headless --num_envs 64 --video --checkpoint logs/rsl_rl/experiment_name/run_name/model_xxx.pt

The video will be saved in the logs/rsl_rl/experiment_name/run_name/videos/play directory.

TODOS

  • Add more legged robots, such as Unitree H1
  • Self-contact penalty in AMP
  • Asymmetric Actor-Critic in AMP
  • Symmetric Reward
  • Sim2sim in mujoco

Acknowledgement

About

Isaac Lab extension for legged robots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published