A complete simulation-to-simulation pipeline for training and deploying the Unitree H12 humanoid robot, bridging Isaac Lab for training with MuJoCo for deployment.
unitree_h12_sim2sim/
├── isaaclab/ # Isaac Lab training environments and robot definitions
│ ├── source/
│ │ └── unitree_h12_sim2sim/ # Isaac Lab extension
│ │ ├── robots/
│ │ │ └── unitree_h12.py # H12 robot definition and configuration
│ │ └── tasks/
│ │ └── manager_based/
│ │ └── unitree_h12_sim2sim/
│ │ ├── unitree_h12_sim2sim_stand_cfg.py # Standing task
│ │ ├── unitree_h12_sim2sim_walk_cfg.py # Walking task
│ │ ├── agents/ # RL training configurations
│ │ └── mdp/ # MDP components (observations, rewards, etc.)
│ └── scripts/
│ └── rsl_rl/ # RSL-RL training scripts
│
├── wbc_agile_utils/ # Training and evaluation utilities
│ ├── train.py # RL policy training script
│ ├── play.py # Run trained policies interactively
│ ├── eval.py # Evaluate trained policies
│ ├── export_IODescriptors.py # Export robot I/O descriptors
│ └── wandb_sweep/ # Weights & Biases hyperparameter sweep configs
│
├── mujoco/ # MuJoCo deployment and evaluation
│ └── sim2mujoco_eval.py # Evaluate policies in MuJoCo simulator
│
└── logs/ # Training logs and checkpoints
└── rsl_rl/
└── unitree_h12_walk/ # Walking task training logs
Contains the simulation environments and robot definitions for training:
- Robot Definition (
robots/unitree_h12.py): Full H12 humanoid configuration with 27 DOF (12 leg + 15 upper body) - Training Environments:
unitree_h12_sim2sim_stand_cfg.py: Standing balance taskunitree_h12_sim2sim_walk_cfg.py: Locomotion task with full-body control
- MDP Components (
mdp/): Reward functions, observations, curriculum, and event definitions
Training and evaluation infrastructure:
- train.py: RSL-RL policy training with support for curriculum learning
- play.py: Interactive policy playback and visualization
- eval.py: Evaluate trained policies on various metrics
- export_IODescriptors.py: Export robot I/O descriptors for deployment
Deployment and validation in MuJoCo:
- sim2mujoco_eval.py: Evaluate Isaac Lab trained policies in MuJoCo simulator
-
Install Isaac Lab following the official guide
-
Install the extension in editable mode:
python -m pip install -e isaaclab/source/unitree_h12_sim2sim- Verify installation by listing available environments:
python isaaclab/scripts/list_envs.pyTrain a walking policy with RSL-RL:
cd wbc_agile_utils
python train.py --task Unitree-H12-Walk-v0 --num_envs 4096 --headlessTrain a standing policy:
cd wbc_agile_utils
python train.py --task Unitree-H12-Stand-v0 --num_envs 4096 --headlessThe evaluation script loads checkpoints, evaluates agent performance, and automatically exports policies to TorchScript and ONNX formats.
cd wbc_agile_utils
python eval.py --task Unitree-H12-Walk-v0 --num_envs 32 --checkpoint <path_to_checkpoint>This generates the task/env specific yaml file, and this is needed to do sim2sim mujoco transfer.
python scripts/export_IODescriptors.py --task Unitree-H12-Walk-v0 --output_dir <path_to_output_dir> Get the official robot models from Unitree's MuJoCo repository:
git clone https://github.com/unitreerobotics/unitree_mujoco.git
# H1_2 robot: unitree_mujoco/unitree_robots/h1_2/scene.xmlEvaluate an Isaac Lab trained policy in MuJoCo:
cd mujoco
python sim2mujoco_eval.py --checkpoint <path_to_checkpoint> --config <path_to_config> --mjcf <path_to_xml>