Skip to content

fix(controller): support the MuJoCo >= 3.10 mj_fullM signature and lift the <3.10 cap - #849

Closed
michele-xilo wants to merge 2 commits into
ARISE-Initiative:masterfrom
michele-xilo:mujoco-3.10-fullm
Closed

michele-xilo wants to merge 2 commits into
ARISE-Initiative:masterfrom
michele-xilo:mujoco-3.10-fullm

Conversation

@michele-xilo

@michele-xilo michele-xilo commented Nov 12, 2026 •

Copy link
Copy Markdown

Why

Right now robosuite only works with MuJoCo below 3.10, because #814 added a mujoco<3.10 cap. That cap is still unreleased on PyPI, so a fresh pip install robosuite breaks as soon as you call make() or step() Two things go wrong on newer MuJoCo:

We hit both while moving our own project to MuJoCo 4, so we figured we'd send the fix back.

What

Verification

  • I ran the full test suite, installed the same way CI does:
    • master with MuJoCo 3.9.0 (Python 3.10): 264 passed;
    • this branch with MuJoCo 3.9.0 and 3.17.0 (Python 3.10) and with 4.0.1 (Python 3.12): 266 passed. The extra two are the new tests, and nothing fails.
  • The new test catches the bug. On master's code it passes with 3.9.0 and fails with 3.11.0 and 4.0.1.
  • black, isort and the CI flake8 check are all clean.

Quick check:

pip install -e . "mujoco>=3.11"
MUJOCO_GL=egl pytest -sx tests/test_controllers/test_mass_matrix.py tests/test_utils/test_binding_utils.py

quinncheong and others added 2 commits November 12, 2026 12:59
…s on MuJoCo >= 3.12

From MuJoCo 3.12 the mjtJoint enum compares unequal to numpy integers when the enum is on the
left, so the hinge/slide assert in get_joint_qpos_addr/get_joint_qvel_addr fails for every arm joint.
…ft the <3.10 cap

MuJoCo 3.10 changed mj_fullM(m, dst, M) to mj_fullM(m, d, dst), and 3.11
removed MjData.qM, so Controller.update() fails on every step with newer
MuJoCo (#817). Call whichever signature the installed MuJoCo has, keeping
the >=3.3.0 floor, and drop the <3.10 cap added in #814.

Adds tests/test_controllers/test_mass_matrix.py, which checks the
controller's mass matrix against one built with mj_mulM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michele-xilo
michele-xilo marked this pull request as ready for review November 12, 2026 13:18
@JonnyFaeth

Copy link
Copy Markdown

I checked the exact API-transition release, MuJoCo 3.10.0, on Windows/Python 3.12.14 at 3493514. With MUJOCO_GL=disable, your mass-matrix test and tests/test_utils/test_binding_utils.py give 2 passed. This runs the real Lift/Panda reset/step and compares the controller matrix against mj_mulM; it does not mock MuJoCo.

For a negative control I forced only the legacy mj_fullM branch: the mass-matrix test fails with the incompatible-arguments TypeError on 3.10.0. Restoring your version dispatch restores the tested source. This complements your 3.9 / 3.17 / 4.0 checks at the boundary itself.

No additional source patch needed from me. I did not run rendering, GPU, hardware, or the full suite. One existing invalid-escape SyntaxWarning appeared in robosuite/init.py. AI assistance: Codex assisted with this verification and executed the local checks.

MonishLokhande added a commit to MonishLokhande/robosuite that referenced this pull request Nov 15, 2026
@michele-xilo michele-xilo closed this by deleting the head repository Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants