Mujoco Toolbox

A modern simulation wrapper for Google DeepMind’s MuJoCo.

Load MJCF or URDF models, run them, record per-step data, and render video in a few lines:

>>> import mujoco_toolbox as mjtb
>>> sim = mjtb.Simulation("robot.xml", duration=5).run(render=True)
>>> sim.save("robot.mp4")
>>> sim.captured_data["qpos"]
Submodules:

This package is pre-1.0 and its API may change between minor releases. Report issues at https://github.com/MGross21/mujoco-toolbox/issues.

Configuration

Module-level settings, read at run time.

mujoco_toolbox.CAPTURE_PARAMETERS: set[str] | str

Default MjData fields recorded by Simulation.run.

Applies to every Simulation created without a capture argument. Set to "all" to record every numeric field:

>>> mjtb.CAPTURE_PARAMETERS = "all"

See the MjData reference for available fields.

mujoco_toolbox.PROGRESS_BAR_ENABLED: bool

Show a progress bar during Simulation.run.

mujoco_toolbox.GUI_ENABLED: bool

Whether a display was detected at import time.

mujoco_toolbox.MAX_GEOM_SCALAR: int = 2

Multiplier on model.ngeom for the renderer’s max_geom scene buffer.