Skip to main content

continuous integration Documentation Status PyPI Python License: MIT

🚀 Latest News: A new release (v1.2) just dropped! 🎉
New: LocoMuJoCo now includes SuperMimic and supports real-robot deployment on the AgiBot X2 Ultra and the Unitree G1 through LocoMuJoCo Real.

LocoMuJoCo is an imitation learning benchmark specifically designed for whole-body control. It features a diverse set of environments, including quadrupeds, humanoids, and (musculo-)skeletal human models, each provided with comprehensive datasets. Although primarily focused on imitation learning, it also supports custom reward functions, making it suitable for pure reinforcement learning as well.

Documentation · Get started · Environments · Training · Sim-to-real · API

Key Advantages

✅ Supports MuJoCo (single environment) and MJX/MJWarp (parallel environments)
✅ Includes 12 humanoid and 4 quadruped environments, featuring 3 biomechanical human models
✅ Clean single-file JAX algorithms for quick benchmarking (SuperMimic, PPO, GAIL, AMP, DeepMimic)
✅ Combined training and environment into one JIT‑compiled function for lightning‑fast training 🚀
✅ Motion capture datasets (AMASS, LAFAN1, native LocoMuJoCo) retargeted for each humanoid
✅ Robot-to-robot retargeting allows to retarget any existing dataset from one robot to another
✅ Powerful trajectory comparison metrics including dynamic time warping and discrete Fréchet distance, all in JAX
✅ Built-in domain and terrain randomization
✅ Real-robot deployment with LocoMuJoCo Real: deployable training setups for PPO and SuperMimic, and the tools to take a policy to the robot
✅ Modular design: define, swap, and reuse components like observation types, reward functions, terminal state handlers, and domain randomization
✅ Documentation


Installation

LocoMuJoCo requires Python 3.10 or newer. We recommend a fresh environment, for example with conda:

conda create -n loco-mujoco python=3.11
conda activate loco-mujoco

Install the latest release from PyPI:

pip install loco-mujoco

Or, to run the examples, change the code or use the SMPL/AMASS extras, clone this repo and do an editable installation:

git clone https://github.com/robfiras/loco-mujoco.git
cd loco-mujoco
pip install -e .

By default, this installs the CPU version of JAX. To use JAX on the GPU:

pip install "jax[cuda12]<=0.10.1,!=0.10.0"

The robot models (about 200 MB) are downloaded automatically the first time you create an environment. The installation guide covers the optional extras, offline use, the MyoSkeleton model and the AMASS setup.

Quick start

Replay motion capture data on a humanoid robot:

from loco_mujoco.task_factories import ImitationFactory, LAFAN1DatasetConf, DefaultDatasetConf

env, traj = ImitationFactory.make("UnitreeH1",
                                  default_dataset_conf=DefaultDatasetConf(["squat"]),
                                  lafan1_dataset_conf=LAFAN1DatasetConf(["dance2_subject4", "walk1_subject1"]))

env.play_trajectory(n_episodes=3, n_steps_per_episode=500, render=True)

Train a policy that tracks a motion with PPO and a DeepMimic-style reward on thousands of parallel MJX environments:

cd examples/training_examples/jax_rl_mimic
python experiment.py

The getting-started guide walks through these steps, and the tutorials folder and the training examples folder contain runnable scripts for every feature and algorithm.


Environments

LocoMuJoCo includes nine humanoid robots, three (musculo-)skeletal human models and four quadrupeds. The environment gallery lists them with their observation and action spaces.


Real Robot Deployment

The AgiBot X2 Ultra running a tracking policy, on the robot and in simulation

LocoMuJoCo Real is the companion repository for taking policies trained in LocoMuJoCo to a real robot. It currently covers the Unitree G1 and the AgiBot X2 Ultra and provides deployable training setups for PPO and SuperMimic and the tools to export, validate and run a policy on the robot. The video shows a SuperMimic tracking policy on the AgiBot X2 Ultra, on the robot and in simulation. The sim-to-real guide explains the stages from training to the robot.


Contributing

Contributions are welcome. See CONTRIBUTING.md for how to report issues, set up a development environment and open a pull request, and CHANGELOG.md for the release history.

Citation

If you use LocoMuJoCo in your research, please cite the paper on the current version:

@article{alhafez2026locomujoco,
title={LocoMuJoCo: A Comprehensive Imitation Learning Benchmark for Whole-Body Control},
author={Firas Al-Hafez and Davide Tateo and Oleg Kaidanov and Aditya Bhatt and Artur Zelik and Zhengyi Luo and Jan Peters},
journal={arXiv preprint arXiv:2611.26293},
year={2026}
}

and the original paper, which describes version 0.1.0 (arXiv:2311.02496):

@inproceedings{alhafez2023b,
title={LocoMuJoCo: A Comprehensive Imitation Learning Benchmark for Locomotion},
author={Firas Al-Hafez and Guoping Zhao and Jan Peters and Davide Tateo},
booktitle={6th Robot Learning Workshop, NeurIPS},
year={2023}
}

Metadata

Release files for loco-mujoco 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loco-mujoco 1.2.1
File Size Uploaded Provenance Actions
loco_mujoco-1.2.1.tar.gz 444.0 kB Without provenance Details for loco_mujoco-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loco-mujoco 1.2.1
File Interpreter ABI Platform Actions
loco_mujoco-1.2.1-py3-none-any.whl Python 3 none any Details for loco_mujoco-1.2.1-py3-none-any.whl

Total release size: 970.8 kB

Release files / loco_mujoco-1.2.1.tar.gz

Download URL loco_mujoco-1.2.1.tar.gz
Size 444.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a80dcee9592f46dbacf5f5100e10d4d48872dcd059f4d360a138d6f51123a402
BLAKE2b-256 checksum
How to use checksums
66d744cecefbe8927c09196ae8c83da48a9928d10e59b611d24118520665cd80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release files / loco_mujoco-1.2.1-py3-none-any.whl

Download URL loco_mujoco-1.2.1-py3-none-any.whl
Size 526.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bcbfa5f5ebf04b7c091ceecc05c129f22684e28534545b3219df374144bc134
BLAKE2b-256 checksum
How to use checksums
de038735d2cfd64037effc0bcf2c75bd37f11d8d10807cf8d6da2fea8b467ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Security for loco-mujoco 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page