A simple baseline implementation accompanying FR-Net: Learning Robust Quadrupedal Fall Recovery on Challenging Terrains through Mass-Contact Prediction (IEEE RA-L 2025 — see Reference).
Quadrupedal fall-recovery RL for the Unitree Go2, built on Isaac Gym /
legged_gym. This is a deliberately minimal baseline: the policy recovers from
arbitrary fallen poses using only the raw 45-dim proprioceptive observation and
plain PPO — no mass-contact prediction. The repo is trimmed to the Go2 robot only
and provides two tasks:
go2— baseline locomotion (velocity tracking) with plain PPO.go2_recovery— fall recovery from arbitrary fallen poses, plain PPO on the simplest 45-dim proprioceptive observation. Seedocs/go2_recovery.mdfor the full policy I/O spec and task design.
go2_recovery — the robot starts upside-down and flips itself back onto its feet
(recorded via record_recovery.py):
Full-resolution clip:
docs/media/go2_recovery.mp4.
A verified, GPU-tested setup (RTX 40-series / sm_89) is documented in
docs/go2_recovery.md. In short:
- Conda env (Python 3.8):
conda create -n unitree_rl_gym python==3.8 conda activate unitree_rl_gym
- PyTorch 2.0.1 + CUDA 11.8 (works on modern GPUs; the old
torch 1.10+cu113does not support sm_89):pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118
- NumPy < 1.24 (Isaac Gym uses the removed
np.float):pip install "numpy==1.23.5" - Isaac Gym Preview 4:
cd isaacgym/python && pip install -e . - This repo:
pip install -e .(extra deps inrequirements.txt).
The PPO implementation is vendored under
legged_gym/algo/ppo, so thersl_rlpackage is not required.
Train → Play
- Train: let the robot interact with the Isaac Gym simulation and learn a policy that maximizes the designed rewards. Headless mode is recommended for speed.
- Play: load a trained checkpoint and visualize / evaluate the policy.
python legged_gym/scripts/train.py --task=go2_recovery --run_name v1 --headless --num_envs 4096--task:go2orgo2_recovery.--headless: run without a viewer (faster). Omit to render.--resume: resume training from a checkpoint inlogs/.--experiment_name: experiment name to run/load.--run_name: name of this run.--load_run: run to load when resuming (default: latest).--checkpoint: checkpoint number to load (default: latest).--num_envs: number of parallel environments.--seed: random seed.--max_iterations: maximum training iterations.--sim_device/--rl_device: e.g.cuda:0, orcpu.
Checkpoints are saved to logs/<experiment_name>/<date_time>_<run_name>/model_<iteration>.pt.
Baseline locomotion:
python legged_gym/scripts/play.py --task=go2Fall recovery (keyboard + optional gamepad):
python legged_gym/scripts/play_recovery.py --task=go2_recoveryA pretrained checkpoint ships with the repo at
logs/GO2_recovery/pretrained_recovery_v3/model_2000.pt, so the command above
works out of the box on a fresh clone (no training needed). To force it
explicitly (e.g. if you already have your own runs):
python legged_gym/scripts/play_recovery.py --task=go2_recovery \
--load_run=pretrained_recovery_v3 --checkpoint=2000Recovery controls:
Space— toggle the policy on/off (off = zero action)Backspace— randomize the robot pose (trigger a fall to recover from)- Arrow keys — linear velocity command (x / y)
A/D— yaw angular-velocity command
During play there is no time-out termination (cfg.env.test = True): the
robot keeps recovering and only resets on demand.
| Task | Description | Obs (actor) | Runner |
|---|---|---|---|
go2 |
Velocity-tracking locomotion | 45-dim | OnPolicyRunner + ActorCritic |
go2_recovery |
Fall recovery from random poses | 45-dim | OnPolicyRunner + ActorCritic |
Details for the recovery task (observation layout, reward shaping, training/play,
environment setup) live in docs/go2_recovery.md.
Built upon these open-source projects:
- unitree_rl_gym — Unitree's RL gym this repo is structured after.
- legged_gym — training/runtime foundation.
- rsl_rl — the PPO implementation this repo's vendored
algo/ppois derived from. - Isaac Gym — physics simulation.
go2_recovery is a simplified baseline of:
- Y. Lu, Y. Dong, J. Zhang, J. Ma, and P. Lu. FR-Net: Learning Robust Quadrupedal Fall Recovery on Challenging Terrains through Mass-Contact Prediction. IEEE Robotics and Automation Letters, 10(7):6632–6639, 2025. DOI:10.1109/LRA.2025.3569117 · IEEE Xplore · arXiv:2509.11504
@ARTICLE{10999057,
author={Lu, Yidan and Dong, Yinzhao and Zhang, Jiahui and Ma, Ji and Lu, Peng},
journal={IEEE Robotics and Automation Letters},
title={FR-Net: Learning Robust Quadrupedal Fall Recovery on Challenging Terrains through Mass-Contact Prediction},
year={2025},
volume={10},
number={7},
pages={6632-6639},
doi={10.1109/LRA.2025.3569117}}BSD 3-Clause License — see LICENSE.
