This repository provides basic reinforcement learning implementations for quadruped locomotion in IsaacLab. It includes support for different robots available at DLS, along with scripts for both sim-to-sim and sim-to-real transfer.
Features:
- Cuncurrent State Estimator
- Rapid Motor Adaptation
- Morphological Symmetries
- Adversarial Motion Priors (big thanks to Giuseppe L'erario and Giulio Romualdi)
- Sim-to-Sim in Mujoco
- Sim-to-Real in ROS1 and ROS2
A list of robots and environments available are described below:
Robot Model | Environment Name (ID) |
---|---|
Aliengo | Locomotion-Aliengo-Flat, Locomotion-Aliengo-Rough-Blind, Locomotion-Aliengo-Rough-Vision |
Go2 | Locomotion-Go2-Flat, Locomotion-Go2-Rough-Blind, Locomotion-Go2-Rough-Vision |
B2 | Locomotion-B2-Flat, Locomotion-B2-Rough-Blind, Locomotion-B2-Rough-Vision |
HyQReal2 | Locomotion-HyQReal-Flat, Locomotion-HyQReal-Rough-Blind, Locomotion-HyQReal-Rough-Vision |
If you find the work useful and you adopt Morphological Symmetries, please consider citing one of our works:
@inproceedings{suhuang2024leveraging,
author={Su, Zhi and Huang, Xiaoyu and Ordoñez-Apraez, Daniel and Li, Yunfei and Li, Zhongyu and Liao, Qiayuan and Turrisi, Giulio and Pontil, Massimiliano and Semini, Claudio and Wu, Yi and Sreenath, Koushil},
booktitle={2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
title={Leveraging Symmetry in RL-based Legged Locomotion Control},
year={2024},
pages={6899-6906},
doi={10.1109/IROS58592.2024.10802439}
}
@article{ordonez2025morphosymm,
author = {Daniel Ordoñez-Apraez and Giulio Turrisi and Vladimir Kostic and Mario Martin and Antonio Agudo and Francesc Moreno-Noguer and Massimiliano Pontil and Claudio Semini and Carlos Mastalli},
title ={Morphological symmetries in robotics},
journal = {The International Journal of Robotics Research},
year = {2025},
doi = {10.1177/02783649241282422},
URL = {https://doi.org/10.1177/02783649241282422},
eprint = {https://doi.org/10.1177/02783649241282422}
}
If you want only to deploy a trained policy on your robot, go directly at the bottom of the readme.
-
Install Isaac Lab by following the installation guide. We recommend using the conda installation as it simplifies calling Python scripts from the terminal.
-
Install git for very large file
sudo apt install git-lfs
-
Clone the repository separately from the Isaac Lab installation (i.e. outside the
IsaacLab
directory) -
Using a python interpreter that has Isaac Lab installed, install the library
python -m pip install -e source/basic_locomotion_dls_isaaclab
-
If you want to play with Morphological Symmetries, install the repo morphosymm-rl
-
If you want to play with Adversarial Motion Priors, install the repo amp-rsl-rl from the AMI research lab.
- To train:
python scripts/rsl_rl/train.py --task=Locomotion-Aliengo-Flat --num_envs=4096 --headless
python scripts/rsl_rl/train.py --task=Locomotion-Aliengo-Rough-Blind --num_envs=4096 --headless
- To train with Symmetries, modify the related rsl_rl_ppo_cfg.py setting class_name = PPOSymmDataAugmented
python scripts/rsl_rl/train_symm.py --task=Locomotion-Aliengo-Flat --num_envs=4096 --headless
python scripts/rsl_rl/train_symm.py --task=Locomotion-Aliengo-Rough-Blind --num_envs=4096 --headless
- To train with AMP, modify the related rsl_rl_ppo_cfg.py setting class_name = AMP_PPO
python scripts/rsl_rl/train_amp.py --task=Locomotion-Aliengo-Flat --num_envs=4096 --headless
python scripts/rsl_rl/train_amp.py --task=Locomotion-Aliengo-Rough-Blind --num_envs=4096 --headless
- To test the policy, you can press:
python scripts/rsl_rl/play.py --task=Locomotion-Aliengo-Flat --num_envs=16
python scripts/rsl_rl/play.py --task=Locomotion-Aliengo-Rough-Blind --num_envs=16
echo "import ray; ray.init(); import time; [time.sleep(10) for _ in iter(int, 1)]" | python3 (TERMINAL 1)
python3 ../basic_locomotion_dls_isaaclab/exts/basic_locomotion_dls_isaaclab/basic_locomotion_dls_isaaclab/hyperparameter_tuning/tuner.py --run_mode local --cfg_file ../basic_locomotion_dls_isaaclab/exts/basic_locomotion_dls_isaaclab/basic_locomotion_dls_isaaclab/hyperparameter_tuning/locomotion_aliengo_cfg.py --cfg_class LocomotionAliengoFlatTuner (TERMINAL 2)
We use model from gym-quadruped.
./isaaclab.sh -p scripts/tools/convert_mjcf.py ../basic_locomotion_dls_isaaclab/scripts/sim_to_sim_mujoco/gym-quadruped/gym_quadruped/robot_model/aliengo/aliengo.xml ../aliengo.usd --import-sites --make-instanceable
Remember to set in the application above, "set as default prim" to the root of the robot. Furthermore, for now, add the following lines in the xml of your robots to make the feet seen as body
<body name="FL_foot" pos="0 0 -0.25">
<!-- FL_foot only collision -->
<geom name="FL" class="collision" size="0.0265" pos="0 0 0" />
</body>
-
install miniforge (x86_64 or arm64 depending on your platform)
-
create an environment using the file in the folder installation:
conda env create -f mamba_environment_ros1.yaml
conda activate basic_locomotion_dls_isaaclab_ros1_env
conda env create -f mamba_environment_ros2.yaml
conda activate basic_locomotion_dls_isaaclab_ros2_env
- Then you can
## Sim-to-Sim
python3 deploy/play_mujoco.py
## Sim-to-Real with ROS1
cd deploy/ros1_ws
catkin_make install -j4
python3 deploy/play_ros1.py
## Sim-to-Real with ROS2
cd deploy/ros2_ws
colcon build
python3 deploy/play_ros2.py
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox' (if want joystick)