Skip to content

mjlab v1.2.0

Choose a tag to compare

@kevinzakka kevinzakka released this 06 Mar 22:22
· 174 commits to main since this release
Immutable release. Only release title and notes can be modified.

Our biggest release yet. 60+ pull requests from 12 contributors. A ground up redesign of domain randomization, major viewer improvements, cloud training support, and many bug fixes.

pip install mjlab
dr_hero.mp4

Domain randomization on the yam lift cube task: cube color, cube size, cube mass, link orientations, link inertias, camera FOV, and lighting all randomized per environment on every reset.

Domain Randomization, Redesigned

Domain randomization is a key technique for sim-to-real transfer. The new dr module replaces the previous randomize_field interface with typed, per-field randomization functions. These functions automatically recompute dependent physical quantities when a parameter is modified. For example, if body mass is randomized, the corresponding inertia values are updated to remain physically consistent. Similarly, when geom size parameters change, the broadphase collision bounds are recomputed. This design removes the need for manual set_const calls and reduces the risk of introducing inconsistent physics states.

import mjlab.envs.mdp.dr as dr

dr.geom_friction(env, cfg, operation=dr.scale, distribution=dr.uniform, ranges=(0.8, 1.2))
dr.pseudo_inertia(env, cfg, alpha_range=(-0.3, 0.3), d_range=(-0.3, 0.3))
dr.mat_rgba(env, cfg, operation=dr.add, distribution=dr.gaussian, ranges=(-0.1, 0.1))

The full lineup covers geometry, bodies, visuals, cameras, and lights. Custom operations and distributions are first class: define your own and pass them anywhere a string is accepted. The native viewer syncs all randomized fields from the GPU model on every reset, so DR changes are immediately visible.

Viewer Overhaul

viewer.mp4

The viewer timing model was rewritten. A single sim budget accumulator with a wall time deadline keeps physics and rendering in sync at any speed multiplier (1/32x to 8x). When physics cannot keep up, the deadline caps the burst so the renderer always gets a turn.

New in both viewers:

  • Single step mode to advance exactly one physics step while paused
  • Error recovery that pauses and logs the traceback instead of crashing
  • Force arrows that visualize apply_body_impulse events in real time
  • Realtime factor displayed alongside FPS

New in Viser:

  • Velocity joystick for manual command override
  • Revamped term plotter with per term filtering
  • Reorganized controls with a cleaner folder hierarchy

Step Events and Body Impulses

The new "step" event mode fires every environment step, not just on reset. Combine it with apply_body_impulse to throw external forces at your robot during training, with configurable duration, magnitude, and application point.

impulse.mp4

Cloud Training

Train on cloud GPUs with a single command. We added SkyPilot integration for Lambda Cloud with docs covering setup, monitoring, and cost management. W&B sweep scripts distribute one agent per GPU across multi GPU instances.

Documentation

The docs have been completely rewritten with improved guides, API reference, and multi versioned support. Check them out at mujocolab.github.io/mjlab.

Also In This Release

  • export-scene CLI to dump any task scene or asset zoo entity to a directory or zip for inspection and debugging
  • rsl-rl-lib upgraded to 5.0.1 with automatic checkpoint migration for the new distribution config format
  • Contact sensor history across decimation substeps for more reliable self collision and illegal contact detection
  • Docker images published on every push to main
  • joint_torques_l2 now accepts actuator_ids for penalizing a subset of actuators

Breaking Changes

  • randomize_field is removed. Use typed functions from the dr module (e.g. dr.geom_friction, dr.body_mass).
  • EventTermCfg no longer accepts domain_randomization.
  • RslRlModelCfg uses distribution_cfg dict instead of stochastic/init_noise_std/noise_std_type. Existing checkpoints are migrated automatically on load.

Bug Fixes

  • Viewer FPS drops from physics starving the renderer (#694, #705)
  • height_scan returning ~0 for missed rays (#646)
  • Ghost mesh rendering for fixed base entities (#645)
  • Actuator target resolution for entities with internal attach prefixes (#714)
  • Offscreen rendering artifacts in large vectorized scenes (#682)
  • Viser viewer crashing on scenes with no mocap bodies (#662)
  • Bundled ffmpeg via imageio-ffmpeg, no more system install required (#650)

New Contributors

Thank you to @Msornerrrr, @rdeits-bd, @jonzamora, @jgueldenstein, @saikishor, @ax-anoop, @chengruiz, @ManuelActisCassa, and @etaoxing!

Full Changelog: v1.1.1...v1.2.0