# LocoMuJoCo: A Comprehensive Imitation Learning Benchmark for Whole-Body Control

Robotics.world

> An MIT-licensed MuJoCo/MJX whole-body control benchmark with 16 embodiments, per-humanoid mocap data and AMASS/LAFAN1 retargeting gives imitation-learning work a shared, GPU-accelerated testbed.

**arXiv**: 2611.26293 · Preprint · not peer-reviewed

**Published**: 2026-11-19

**Authors**: Firas Al-Hafez, Davide Tateo, Oleg Kaidanov, Aditya Bhatt, Artur Zelik, Zhengyi Luo, Jan Peters

## In plain words

Research on learning whole-body controllers for humanoid robots is fragmented: each project tends to live in its own single-robot codebase, and researchers must rebuild data pipelines, retargeting code, simulators, and evaluation metrics every time they change robots.

## AI summary

## Overview

**Research area:** Robotics — imitation learning, reinforcement learning, and whole-body control for humanoid and legged robots; software benchmarking infrastructure.

**Technical level:** Advanced. The paper assumes familiarity with reinforcement learning, motion retargeting, and GPU-parallel simulation (JAX/MJX), though the motivating problem is stated plainly.

**Scope (one sentence):** LocoMuJoCo is an open-source, MIT-licensed benchmark library that unifies CPU and GPU simulation backends, a large set of humanoid/skeletal/quadruped embodiments, curated motion-capture data, an automated retargeting pipeline, reference learning algorithms, and trajectory-similarity metrics under a single API for whole-body imitation and reinforcement learning.

## What This Paper Is About

Research on learning whole-body controllers for humanoid robots is fragmented: each project tends to live in its own single-robot codebase, and researchers must rebuild data pipelines, retargeting code, simulators, and evaluation metrics every time they change robots. LocoMuJoCo addresses this by providing one library in which embodiments, datasets, observations, rewards, terrains, and randomization are interchangeable plug-ins, and in which the same training loop runs on a serial CPU simulator or a vectorized GPU simulator. The paper describes the library's design, its three-stage motion-retargeting pipeline, its bundled algorithms and metrics, and a companion repository for deploying trained policies to real hardware.

## Key Contributions

1. **A dual-backend simulation core.** Each environment runs through either a serial NumPy/MuJoCo backend or a vectorized JAX/MJX backend, implemented once against a numerical-backend argument so that most code is shared verbatim; an optional MjWarp backend is enabled with `use_mjwarp=True` and reaches 4.9 × 10⁵ steps per second on one consumer GPU.
2. **A broad embodiment and dataset suite with general retargeting.** The library exposes 9 humanoid robots (Unitree H1/H1v2/G1, Atlas, Talos, Apollo, Booster T1, ToddlerBot, Fourier GR1T2), 3 SMPL-derived (musculo-)skeletal models (MyoSkeleton, SkeletonTorque, SkeletonMuscle), and 4 quadrupeds (Unitree A1/Go2, BD Spot, ANYmal C), ships a curated native motion-capture dataset per humanoid, and retargets AMASS and LAFAN1. Adding a new robot requires only a configuration file and 15 mimic sites.
3. **A modular, JIT-compilable plug-in architecture.** Observations, rewards, control modes (direct motor or muscle actuation, PD), domain randomization, terrain types, and initial/terminal state handlers are stateless plug-ins whose per-environment state lives in explicit Flax dataclasses, so the whole environment step compiles under `jax.jit` and `jax.vmap`.
4. **Bundled algorithms, metrics, and sim-to-real tooling.** Compact JAX/Flax implementations of PPO, GAIL, AMP, DeepMimic-style tracking, SuperMimic, BPTT-PPO, Transformer-based history-aware PPO, SAC, TD3, S2PG, and a DAgger-style distillation pipeline are provided, alongside a metrics module backed by the JAX-native `metrx` library and a companion `loco-mujoco-real` repository for deployment.

## Main Findings

- **Positioning against existing libraries:** Table 1 compares LocoMuJoCo against HumanoidBench, MyoSuite, mjlab, ProtoMotions, and MimicKit on five axes — dual backend, built-in retargeting, biomechanics (muscles), trajectory metrics, and sim-to-real tooling. LocoMuJoCo is the only one marked as supporting all five; the authors note each competitor is strong on one or two axes.
- **Retargeting accuracy on the Unitree G1:** In the per-robot shape-fitting stage, the mean 15-site correspondence error decreases from 112.1 mm to 21.8 mm after optimization.
- **Soft-constraint retargeting avoids physically invalid poses:** Stage 2 drives the robot with MuJoCo soft `mjEQ_WELD` constraints and 25 sub-steps per frame, so collisions and joint limits are enforced jointly with constraint satisfaction, which the authors contrast with rigid-IK retargeters that routinely produce ground-penetrating or self-colliding poses.
- **Robot-to-robot transfer works through a synthetic SMPL intermediate:** A walking trajectory from Unitree H1v2 is successfully transferred onto Booster T1 by inverting the source motion into SMPL coordinates and re-running the forward stage with the target robot's fitted shape.
- **Sim-to-real transfer demonstrated on two robots:** The `loco-mujoco-real` repository covers the Unitree G1 and the AgiBot X2 Ultra. Figure 2 shows a motion-tracking policy for the AgiBot X2 Ultra, trained with domain randomization on the MjWarp backend, executing a 43 s whole-body motion at 50 Hz on the real robot.
- **Large-scale evaluation:** Appendix H reports a 715-run evaluation across 11 embodiments together with algorithm comparisons.
- **Throughput:** The MjWarp backend reaches 4.9 × 10⁵ steps per second on one consumer GPU.
- **Engineering robustness:** The `pytest` suite has more than 500 tests and reaches 93% line coverage of the `loco_mujoco` package as measured with `coverage.py`, excluding interactive viewers, license-restricted model code, dataset downloads, and package `__init__` files.

## Methodology in Plain English

The authors engineered the library rather than running a single hypothesis test. Their approach has four parts.

**One environment, two execution paths.** Environment logic (observations, rewards, controls, terminations) is written once against a "numerical backend" argument. Because `jax.numpy` closely mirrors NumPy, almost all code is shared; only backend-specific operations branch. Prototyping happens on the CPU loop; training happens on the GPU loop where `jax.jit` and `jax.vmap` step many environments in parallel. The paper's usage example constructs a `MjxUnitreeH1` squat environment once and steps it both ways.

**Everything variable is a plug-in.** Robots differ in degrees of freedom, actuator type, and observation channels. Rather than hard-coding one environment class per robot-task pair, each environment is assembled from orthogonal components: observation specs (joint positions, velocities, base orientation, mimic-site positions, contact forces), reward classes (from `NoReward` through velocity-tracking shaping to `MimicReward`), control modes (`DefaultControl` for direct motor/muscle actuation, `PDControl` for lower-bandwidth targets), a randomizer covering gravity, friction, stiffness, damping, link masses, root center-of-mass offset, joint friction/damping/armature, PD gains, and observation noise, plus terrain (flat or a rough heightfield regenerated at reset) and termination handlers. Because plug-ins are stateless and keep their state in Flax dataclasses, the step compiles cleanly and the same training script spans all robots.

**Three-stage retargeting.** Stage 1 (run once per robot) poses the robot in a canonical T-pose, forward-simulates to get its 15 mimic-site positions, and optimizes an SMPL body shape plus an isotropic scale to align SMPL to the robot using Adam for 1000 iterations at learning rate 0.05, then records a per-site rigid offset in SE(3), a feet-height correction, and a head-to-feet ratio. Stage 2 takes any SMPL motion clip, runs forward kinematics with the fitted shape to produce per-frame world-frame target positions and orientations for the 15 sites, attaches each to the robot via a soft MuJoCo weld constraint, and integrates 25 sub-steps per frame to get the robot's generalized coordinates; velocities come from central differences, and an optional per-trajectory floor offset keeps the worst frame just touching the ground. Stage 3 reverses the process for robot-to-robot transfer: an optimization fits an SMPL pose trajectory to the source robot's site poses while holding the source shape fixed (Adam, 400 iterations, position weight 1.0, rotation weight 0.1, Gaussian smoothing with kernel size 3 and σ = 0.5), yielding a synthetic SMPL clip that is then fed into Stage 2 with the target robot's shape.

**Fused training loops and shared metrics.** Each algorithm is a single module with the environment step and the policy/critic update fused into one JIT-compiled function built from `lax.scan`, removing Python overhead between steps. Evaluation goes through `metrx`, computing Euclidean, dynamic time warping, and discrete Fréchet distances over 11 joint, body, and site quantities.

## Why This Matters

**Impact on research.** Fragmentation is a genuine methodological problem in this subfield: when every paper uses a different robot, dataset, and evaluation metric, reported numbers are not comparable. LocoMuJoCo provides a common substrate — the same 15-site correspondence defined once in a shared YAML configuration and reused across all registered humanoids, a curated frozen dataset per humanoid, and trajectory-similarity metrics computed identically across embodiments. Its 715-run evaluation across 11 embodiments is an example of the kind of comparison that becomes cheap once the infrastructure is shared. The library also lowers the cost of cross-embodiment experiments: adding a robot takes a configuration file and 15 mimic sites rather than a new codebase.

**Real-world applications.**

- **Humanoid locomotion and whole-body control:** training motion-tracking policies from human mocap and deploying them on hardware, as demonstrated on the AgiBot X2 Ultra at 50 Hz over a 43 s motion and on the Unitree G1.
- **Biomechanics and rehabilitation research:** the SMPL-derived SkeletonTorque and SkeletonMuscle models support muscle actuation and body scaling to different anthropometric sizes, enabling studies of how controller performance varies with human body size.
- **Quadruped locomotion:** the four included quadrupeds (Unitree A1/Go2, BD Spot, ANYmal C) support standard legged-locomotion RL with terrain and domain randomization.
- **Teaching and reproducible benchmarking:** a single pip-installable package with a passing test suite and documented plug-in slots is a practical base for courses and for reproducing published results.

**Industry relevance.** Sim-to-real is the bottleneck between research prototypes and deployed legged robots. The companion `loco-mujoco-real` repository provides the export, sim-to-sim check, and on-robot execution path for two commercial platforms, and the PD-control option is explicitly motivated by what is commonly deployed in sim-to-real legged systems. The MIT license and the HuggingFace-hosted datasets reduce integration friction for industrial teams.

## Future Directions

- **Broadening the sim-to-real coverage.** Deployment tooling currently exists for two robots, the Unitree G1 and the AgiBot X2 Ultra. Extending validated real-robot pipelines to the remaining embodiments in the suite is the obvious next step, since a benchmark's credibility for hardware work depends on which robots have been demonstrated end to end.
- **Retargeting quality versus newer methods.** The paper positions its pipeline against GMR (non-uniform scaling plus differential inverse kinematics, targeting real-time use) and OmniRetarget (contact preservation with objects and terrain). Whether the SMPL-fit-plus-soft-constraint approach matches these on contact-rich and object-interaction motions is an open empirical question the paper does not resolve.
- **Keeping pace with algorithm development.** The library already carries a wide algorithm set (PPO, GAIL, AMP, DeepMimic-style tracking, SuperMimic, BPTT-PPO, history-aware PPO, SAC, TD3, S2PG, DAgger distillation), with several marked as experimental. The benchmark's value depends on continuing to add methods and on the community adopting the shared evaluation protocol rather than reporting on bespoke setups.
- **Scaling the evaluation and the license-restricted paths.** The reported comparison spans 715 runs across 11 embodiments, leaving 5 of the 16 listed embodiments outside that evaluation; expansion, and clearer handling of the AMASS/MyoSkeleton license restrictions that keep parts of the pipeline outside automated testing, are natural follow-ups.

## Target Audience

Researchers and engineers working on humanoid and legged-robot control who need a reproducible environment for comparing imitation-learning and reinforcement-learning methods across embodiments. It is most valuable to (1) IL/RL researchers who want to benchmark a new algorithm without rebuilding retargeting, datasets, and metrics; (2) robotics engineers planning sim-to-real transfer for a humanoid or quadruped platform; (3) biomechanics-oriented researchers who need muscle-actuated skeletal models with adjustable body scaling; and (4) students or lab groups entering whole-body control who want a working, tested, MIT-licensed starting point. Readers looking for a novel learning algorithm will not find one here — the contribution is infrastructure, and the paper is best read alongside the repository documentation.

## Authors’ abstract

LocoMuJoCo is an open-source benchmark for imitation learning (IL) and reinforcement learning (RL) on whole-body control. The library couples MuJoCo (CPU) with MJX and the MjWarp backend (GPU) under a single API, exposes 9 humanoid, 3 (musculo-)skeletal, and 4 quadruped embodiments, and ships a curated native motion-capture dataset for every humanoid, to which it can also retarget AMASS and LAFAN1. A modular plug-in architecture makes observations, rewards, control modes,…

[The full abstract on arXiv](https://arxiv.org/abs/2611.26293)

[Read the original paper](https://arxiv.org/abs/2611.26293)

## Related papers

- [Blind Dexterity: Whole-Body Humanoid Manipulation via Pure Proprioception](https://robotics.world/paper/blind-dexterity-whole-body-humanoid-manipulation-via-pure-proprioception-2608.29487) 2026-08-30 · cs.RO · Also by Aditya Bhatt, Jan Peters +1
- [Whole-Body Humanoid Control via Stochastic Motion Tokenization](https://robotics.world/paper/whole-body-humanoid-control-via-stochastic-motion-tokenization-2610.36452) 2026-10-27 · cs.RO · Also by Jan Peters
- [ECHO: In-Context Behavior foundation model for Humanoid Whole-Body Control](https://robotics.world/paper/echo-in-context-behavior-foundation-model-for-humanoid-whole-body-2611.25778) 2026-11-19 · cs.RO · Key terms of the title in common
- [Driving the Style: Velocity-Conditioned Whole-Body Control from Motion Demonstrations](https://robotics.world/paper/driving-the-style-velocity-conditioned-whole-body-control-from-motion-2611.20888) 2026-11-16 · cs.RO · Key terms of the title in common
- [MoViC: Real-Time Humanoid Whole-Body Control from Monocular Video Streams](https://robotics.world/paper/movic-real-time-humanoid-whole-body-control-from-monocular-video-streams-2611.19998) 2026-11-15 · cs.RO · Key terms of the title in common

---

Canonical: https://robotics.world/paper/locomujoco-a-comprehensive-imitation-learning-benchmark-for-whole-body-2611.26293
