GitHub Hot Board

GitHub Hot Board · Archivio repository

yhx1203/parkour_mjlab

Reinforcement learning codebase built on MJLab for Unitree G1 and Go2 Parkour. (Questa descrizione proviene dal repository.)

Dati al October 22yhx1203

Miglior posizione

#85

Gemme ignorate

100

Stelle totali

10

Fork totali

1

Giorni in classifica (30 g)

Stato del progettoLicenza: sconosciutoUltimo push: sconosciutoIssue aperte (PR incl.): sconosciuto

Raccolto dal 2026-10-25; sconosciuto = non ancora raccolto

Metti il badge nel tuo README · yhx1203/parkour_mjlab[![Metti il badge nel tuo README](https://git.vaiox.xyz/api/badge/yhx1203/parkour_mjlab.svg)](https://git.vaiox.xyz/it/repo/yhx1203/parkour_mjlab)
<a href="https://git.vaiox.xyz/it/repo/yhx1203/parkour_mjlab"><img src="https://git.vaiox.xyz/api/badge/yhx1203/parkour_mjlab.svg" alt="Metti il badge nel tuo README" height="20"></a>

Documentazione del progetto

Parkour MJLab

Overview

parkour_mjlab is a reinforcement learning codebase built on MJLab for perceptive locomotion with Unitree G1 humanoid and Go2 quadruped robots.

Installation

Conda environment

conda create -n mjlab python=3.11
conda activate mjlab

Install dependencies

sudo apt install -y libyaml-cpp-dev libboost-all-dev libeigen3-dev libspdlog-dev libfmt-dev

Install parkour_mjlab

git clone https://github.com/yhx1203/parkour_mjlab
cd parkour_mjlab
pip install -e .

Tasks

🐕 Go2

PIE

Train

python scripts/train.py Unitree-Go2-PIE \
  --agent.run-name stairs

Play

python scripts/play.py \
  --checkpoint-file logs/rsl_rl/go2_pie/model_8000.pt \
  --viewer viser \
  --network-depth-vis \
  --terrain-level 9 \
  --num-envs 1 \
  --device cuda:0

Native Sim2Sim

python deploy/pie/sim2sim/go2_pie_sim2sim.py \
  --checkpoint-file logs/rsl_rl/go2_pie/policy.onnx \
  --provider cpu \
  --terrain stairs \
  --joystick \
  --joystick-type xbox \
  --show-depth

🤖️ G1

PHP

Download the five motion bundles from the PHP training motion release and extract them into src/assets/motions/php_motion/ with the following directory structure:

src/assets/motions/php_motion/
├── php-motions-high-climb-76-v1/
├── php-motions-high-step-v1/
├── php-motions-locomotion-v1/
├── php-motions-low-climb-76-v1/
└── php-motions-low-step-v1/

Teacher

Train

# Train one teacher; replace Locomotion with Low-Climb, High-Step, Low-Step, or High-Climb as needed.
python -m scripts.train \
  Unitree-G1-PHP-Locomotion-Teacher \
  --env.scene.num-envs=2048 \
  --agent.max-iterations=200000 \
  --agent.save-interval=2000 \
  --env.sim.mujoco.ccd-iterations=500 \
  --agent.logger=wandb \
  --agent.wandb-project=php-teachers \
  --agent.run-name=php_locomotion_gpu0

Play

python -m scripts.play \
  Unitree-G1-PHP-Locomotion-Teacher \
  --checkpoint-file="logs/rsl_rl/g1_php_locomotion_teacher/model_20000.pt" \
  --num-envs=1 \
  --motion-id=11 \
  --terrain-variant=0 \
  --viewer=viser 

Student

Train

T_LOCOMOTION="logs/rsl_rl/g1_php_locomotion_teacher/model_20000.pt"
T_LOW_STEP="logs/rsl_rl/g1_php_low_step_teacher/model_20000.pt"
T_HIGH_STEP="logs/rsl_rl/g1_php_high_step_teacher/model_20000.pt"
T_LOW_CLIMB="logs/rsl_rl/g1_php_low_climb_teacher/model_20000.pt"
T_HIGH_CLIMB="logs/rsl_rl/g1_php_high_climb_teacher/model_20000.pt"

python -m scripts.train \
  Unitree-G1-PHP-Student \
  --env.scene.num-envs=1024 \
  --agent.teacher-checkpoint-files="('$T_LOCOMOTION', '$T_LOW_STEP', '$T_HIGH_STEP', '$T_LOW_CLIMB', '$T_HIGH_CLIMB')" \
  --agent.max-iterations=30000 \
  --agent.save-interval=1000 \
  --env.sim.mujoco.ccd-iterations=500 \
  --agent.logger=wandb \
  --agent.wandb-project=php-student \
  --agent.run-name=php_student_5teachers

Play

python -m scripts.play Unitree-G1-PHP-Student \
  --checkpoint-file=logs/rsl_rl/g1_php_student/model_23000.pt \
  --php-skill=High-Climb \
  --terrain-variant=0 \
  --num-envs=1 \
  --viewer=viser 

Sim2sim

# Export for native MuJoCo.
python -m deploy.php.sim2sim.export_student_onnx \
  --checkpoint-file logs/rsl_rl/g1_php_student/model_23000.pt \
  --output-file logs/rsl_rl/g1_php_student/model_23000.onnx

# Terminal keyboard control on the three-obstacle course, with policy depth at upper-right.
python -m deploy.php.sim2sim.run_mujoco \
  --policy logs/rsl_rl/g1_php_student/model_23000.onnx \
  --terrain-file deploy/php/sim2sim/assets/custom_obstacles.xml \
  --command-source terminal --show-depth --duration 0

W: forward, Q/E: left/right 45°, A/D: left/right 90°, T: walk/run, S: stand, R: reset. Commands stay active after releasing the key.

Thanks to the PHP authors for open-sourcing their work.

Amp + Parkour Sim2Sim
python -m deploy.parkour.sim2sim --gamepad-type xbox --show-depth

parkour

手柄控制:

  • 左摇杆:AMP 前进/横移速度;
  • 右摇杆:AMP 转向速度;
  • LB+A:切到 AMP;
  • LB+Y:切到 Parkour;
  • LB+B:重置机器人、回到 AMP。
Stair SDK2 Sim2Sim

Install unitree_sdk2_python, then start the MuJoCo server:

python deploy/stair/sim2sim/unitree_mujoco_stair_server.py \
  --show-depth --domain-id 6 --interface lo --duration 0

In a second terminal, start the controller:

python deploy/stair/sim2sim/g1_stair_unitree_mujoco.py \
  --checkpoint-file logs/rsl_rl/g1_stair/stair_test/policy.onnx \
  --domain-id 6 --interface lo --cmd-x 0.6 --duration 0

Roadmap

  • Release the Go2 PIE training code
  • Release the Go2 PIE sim2sim deployment code (MuJoCo)
  • Release the Go2 PIE sim2real deployment code
  • Release the G1 Stair sim2sim deployment code (MuJoCo + SDK2)
  • Release the G1 Goal Stair code
  • Release the G1 PHP training and sim2sim code
  • Release the G1 AME code
  • Release the G1 CREF code

Acknowledgements

License

The project's original code, documentation, and the model weights listed in logs/LICENSE are licensed under Apache-2.0. Third-party materials retain their own licenses; see NOTICE.

Classifiche attuali

  • 85

    Gemme ignorate

    100 stelle · 10 fork · Star totali (crescente)

    Ignorate →

Andamento degli ultimi 30 giorni

Stelle cumulate

Andamento della posizione

← Torna alle classifiche