YAHMP is an open-source framework for training, evaluating, and deploying general motion tracking policies on the Unitree G1. It is built on top of mjlab and includes the nominal policy, the design variants studied in the accompanying paper, and a privileged teacher-student training pipeline.
g1-yahmp.mp4
The supplementary video is available at https://youtu.be/BH6FpQzwm8M.
YAHMP supports Python 3.11--3.13. Install uv and create the project environment:
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/fabio-amadio/yahmp.git
cd yahmp
uv syncVerify that the tasks are registered:
uv run list_envs | grep YAHMPDownload the retargeted OMOMO and AMASS motions from Google Drive. Extract the archive so that the dataset is located at:
assets/motions/g1_omomo_amass_clean/
The default motion configuration is src/yahmp/config/g1/motion_data_cfg.yaml. The supported motion formats are described in assets/motions/README.md.
The nominal policy uses a 10-step observation history, joint-position and joint-velocity references, residual actions, and mechanics-based PD gains and action scales.
| Configuration | Task ID | Difference from nominal |
|---|---|---|
| Nominal | Mjlab-YAHMP-Unitree-G1 |
- |
| No history | Mjlab-YAHMP-NoHistory-Unitree-G1 |
Removes observation history and its encoder |
| History-20 | Mjlab-YAHMP-History20-Unitree-G1 |
Uses a 20-step observation history |
| Position-reference-only | Mjlab-YAHMP-QOnly-Unitree-G1 |
Removes reference joint velocities |
| No residual | Mjlab-YAHMP-NoResidual-Unitree-G1 |
Applies actions around a fixed default posture |
| Stiffer fixed-scale | Mjlab-YAHMP-StiffPD-Unitree-G1 |
Uses stiffer PD gains and constant action scales |
| Hand-force randomization | Mjlab-YAHMP-HandForceRand-Unitree-G1 |
Applies randomized feasible forces at the hands during training |
| Privileged teacher | Mjlab-YAHMP-Teacher-Unitree-G1 |
Trains the privileged teacher used by the student |
| Teacher-student | Mjlab-YAHMP-Student-RL+KL-Matching-Unitree-G1 |
Trains the deployable student with PPO and KL matching |
Run a short local smoke test without W&B:
uv run train Mjlab-YAHMP-Unitree-G1 \
--env.scene.num-envs 64 \
--agent.max-iterations 2 \
--agent.logger tensorboardTrain the nominal policy with the paper configuration:
uv run train Mjlab-YAHMP-Unitree-G1 \
--env.scene.num-envs 8192Training uses W&B by default and runs for 20,000 PPO iterations. Replace the task ID with any entry in the table to train that configuration. To keep a full run local, add --agent.logger tensorboard.
First train the privileged teacher:
uv run train Mjlab-YAHMP-Teacher-Unitree-G1 \
--env.scene.num-envs 8192Then train the student from the teacher checkpoint:
uv run train Mjlab-YAHMP-Student-RL+KL-Matching-Unitree-G1 \
--env.scene.num-envs 8192 \
--agent.teacher-checkpoint-file /path/to/teacher/model_latest.ptA teacher stored on W&B can instead be selected with --agent.teacher-wandb-run-path entity/project/run_id.
Check the environment with a zero-action policy:
uv run play Mjlab-YAHMP-Unitree-G1 --agent zeroPlay a local training checkpoint:
uv run play Mjlab-YAHMP-Unitree-G1 \
--checkpoint-file /path/to/model_latest.ptUse --motion-file /path/to/motion.npz to select a motion and --video True to record the rollout. A checkpoint stored on W&B can be loaded with --wandb-run-path entity/project/run_id.
Export a trained model to ONNX format:
uv run python -m yahmp.scripts.deploy.export_checkpoint_to_onnx \
--task-id Mjlab-YAHMP-Unitree-G1 \
--checkpoint-file /path/to/model_latest.pt \
--output-path assets/models/exported_policy.onnxThe repository includes the nominal policy at assets/models/g1_yahmp.onnx.
Run the nominal policy directly in MuJoCo:
uv run python -m yahmp.scripts.deploy.run_yahmp_onnx_mujoco \
--task-id Mjlab-YAHMP-Unitree-G1 \
--onnx-path assets/models/g1_yahmp.onnx \
--motion-file assets/motions/g1_omomo_amass_clean/<motion-name>.npzEvaluate the nominal policy over the configured motion dataset:
uv run python -m yahmp.scripts.evaluation.evaluate_policy \
--onnx-path assets/models/g1_yahmp.onnx \
--output-dir assets/logs/yahmp_evalMotion rendering, checkpoint export, and evaluation commands are documented in src/yahmp/scripts/README.md.
This repository accompanies the paper What Matters in Humanoid General Motion Tracking? An Empirical Study, accepted at Humanoids 2026:
@inproceedings{amadio2026what,
title = {What Matters in Humanoid General Motion Tracking? An Empirical Study},
author = {Amadio, Fabio and Mingo Hoffman, Enrico},
booktitle = {IEEE-RAS International Conference on Humanoid Robots (Humanoids)},
year = {2026}
}Install the development dependencies and run the checks with:
uv sync --group dev
make format
make checkYAHMP is released under the Apache 2.0 license.