LoopSR: Looping Sim-and-Real for Lifelong Policy Adaptation of Legged Robots
Peilin Wu, Weiji Xie, Jiahang Cao, Hang Lai, Weinan Zhang*
IROS 2025
-
Create a new python virtual env with python 3.8 (3.8 recommended). i.e. with conda:
conda create -n isaacgym python==3.8conda activate isaacgym
-
Install pytorch 1.10 with cuda-11.3:
pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
For GTX4050 or Higher, install pytorch 2.0.1 with cuda-11.7:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
-
Install Isaac Gym, copy the isaacgym folder (with a backup in /NAS2020/Share/Robotics/legged_gym_env) to your own path, i.e., ~/, and:
cd isaacgym/python && pip install -e .
-
Install other dependence
pip install -r requirements
-
Troubleshooting
-
sudo apt-get update -
sudo apt-get install build-essential --fix-missing -
pip install setuptools==59.5.0
-
- run the command:
python legged_gym/scripts/train.py --task=go2_amp --headless --sim_device=cuda:0 --run_name=collect_policy
- run the command:
python legged_gym/scripts/play.py --task=a1_amp --sim_device=cpu
- Collect Dataset
python legged_gym/scripts/collect.py --task=go2_amp --data_path=go2
- Train LoopSR Encoder
python encoders/train_encoder.py
- Use the Encoder in Sim-to-sim Experiments
python legged_gym/scripts/refine_sim.py --encoder=path/to/your/encoder/checkpoint --data_path=go2
- Use the Encoder in Sim-to-real Experiments
- Collect data in the real scene and put it in the record/ directory
python legged_gym/scripts/refine_real.py --encoder=path/to/your/encoder/checkpoint --data_path=go2
If you find this code or find the paper useful for your research, please consider citing:
@article{wu2024loopsr,
title={LoopSR: Looping Sim-and-Real for Lifelong Policy Adaptation of Legged Robots},
author={Wu, Peilin and Xie, Weiji and Cao, Jiahang and Lai, Hang and Zhang, Weinan},
journal={arXiv preprint arXiv:2409.17992},
year={2024}
}
