Skip to content

ZihanWang0422/legged_rl_lab

Repository files navigation

legged_rl_lab

IsaacSim Isaac Lab Python Linux platform License

Overview

This project is a set of tools for end-to-end development of RL for robots. Specifically, we support:

  • RL tasks in IsaacLab.
    • Quadruped blind climb stairs.
    • Quadruped footstand.
  • Sim2Sim transfer using Mujoco.
  • Sim2Real transfer using Unitree_legged_sdk.
Isaac Lab
Mujoco
Physical

🧰️Setup

conda create -n env_isaaclab python=3.11
conda activate env_isaaclab
pip install -U torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu128
pip install --upgrade pip
  • Install isaacsim 5.1 and isaaclab 2.3
pip install isaaclab[isaacsim,all]==2.3.0 --extra-index-url https://pypi.nvidia.com

Verify the installization

isaacsim
  • Install the project
python -m pip install -e source/legged_rl_lab
  • List the tasks available in the project
python scripts/list_envs.py

🚀Train

Clone USD model

git clone https://huggingface.co/zihan0422/legged_rl_lab

Then

Convert URDF to USD (recommend)

cd ~/legged_rl_lab

python scripts/tools/convert_urdf.py   source/legged_rl_lab/legged_rl_lab/data/robots/go1_description/urdf/go1.urdf   source/legged_rl_lab/legged_rl_lab/data/robots/go1_description/usd/go1.usd   --merge-joints   --joint-stiffness 100.0   --joint-damping 0.5   --joint-target-type position

Then modify the unitree.py motor configration to align with the USD parameters.

Walk (Flat)

Train

python scripts/rsl_rl/train.py \
  --task=LeggedRLLab-Isaac-Velocity-Flat-Unitree-Go1-v0 \
  --num_envs 4096 \
  --headless \
  --resume \
  --load_run /path/to/log/folder \
  --checkpoint model_xx.pt  

Play

python scripts/rsl_rl/play.py \
    --task=LeggedRLLab-Isaac-Velocity-Flat-Unitree-Go1-v0 \
    --num_envs 16

Walk(rough)

Train

python scripts/rsl_rl/train.py \
  --task=LeggedRLLab-Isaac-Velocity-Rough-Unitree-Go1-v0 \
  --num_envs 4096 \
  --headless

Play

python scripts/rsl_rl/play.py \
    --task=LeggedRLLab-Isaac-Velocity-Rough-Unitree-Go1-v0 \
    --num_envs 16

Handstand

Train

python scripts/rsl_rl/train.py \
  --task=LeggedRLLab-Isaac-Velocity-Handstand-Unitree-Go1-v0 \
  --num_envs 4096 \
  --headless

Play

python scripts/rsl_rl/play.py \
    --task=LeggedRLLab-Isaac-Velocity-Handstand-Unitree-Go1-v0 \
    --num_envs 16

Navigation

Train

# Flat terrain navigation
python scripts/rsl_rl/train.py --task LeggedRLLab-Isaac-Navigation-Flat-Unitree-Go1-v0 --num_envs 4096 --headless --resume --load_run 2026-02-11_18-18-04 --checkpoint model_2700.pt

# Obstacle terrain navigation (with cylinders)
python scripts/rsl_rl/train.py \
  --task LeggedRLLab-Isaac-Navigation-Obstacle-Unitree-Go1-v0 \
  --num_envs 4096 \
  --headless \
  --resume \
  --load_run 2026-02-13_14-44-01 \
  --checkpoint model_1700.pt

Play

# Flat terrain navigation
python scripts/rsl_rl/play.py \
    --task=LeggedRLLab-Isaac-Navigation-Flat-Unitree-Go1-Play-v0 \
    --num_envs 16

# Obstacle terrain navigation
python scripts/rsl_rl/play.py \
    --task=LeggedRLLab-Isaac-Navigation-Obstacle-Unitree-Go1-Play-v0 \
    --num_envs 16

Metamorphology

Train

python scripts/rsl_rl/train.py     --task LeggedRLLab-Isaac-Velocity-Flat-Procedural-Quadruped-v0     --num_envs 4096     --headless

Play

python scripts/rsl_rl/play.py     --task LeggedRLLab-Isaac-Velocity-Flat-Procedural-Quadruped-v0     --num_envs 32

Sim2Sim

Define own task:

  1. Modify the yaml file in legged_rl_lab/deploy/config

  2. Exported the policy.pt to legged_rl_lab/deploy/exported_policy

  3. Detail sim2sim guide in sim2sim guide

  4. Play the sim2sim script

pip install mujoco
#Walk
python deploy/sim2sim_walk.py --mode sim --model policy.pt
#Handstand
python deploy/sim2sim_handstand.py --mode sim --model policy.pt

Sim2Real

python sim2sim2real_joystick.py --mode real --model policy_45_continus.pt #play in real-world

Troubleshooting

Pylance Missing Indexing of Extensions

In some VsCode versions, the indexing of part of the extensions is missing. In this case, add the path to your extension in .vscode/settings.json under the key "python.analysis.extraPaths".

{
    "python.analysis.extraPaths": [
        "<path-to-ext-repo>/source/legged_rl_lab"
    ]
}

Restart Terminal

pkill -f "python.*train.py"

About

Isaaclab extension reporsity (sim2sim2real)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages