Repository navigation
fix(controller): support the MuJoCo >= 3.10 mj_fullM signature and lift the <3.10 cap - #849
michele-xilo wants to merge 2 commits into
Conversation
…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>
|
I checked the exact API-transition release, MuJoCo 3.10.0, on Windows/Python 3.12.14 at 3493514. With For a negative control I forced only the legacy 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. |
Why
Right now robosuite only works with MuJoCo below 3.10, because #814 added a
mujoco<3.10cap. That cap is still unreleased on PyPI, so a freshpip install robosuitebreaks as soon as you callmake()orstep()Two things go wrong on newer MuJoCo:mj_fullM, and 3.11 removedMjData.qM. So every controller step crashes.mjtJointenums stop comparing equal to numpy ints when the enum is on the left. That makes the hinge/slide assert inget_joint_qpos_addrfail. @quinncheong already fixed this in fix(binding_utils): compare jnt_type as int so hinge/slide joints pass on MuJoCo >= 3.12 #832.We hit both while moving our own project to MuJoCo 4, so we figured we'd send the fix back.
What
controllers/parts/controller.pynow callsmj_fullMwith whichever signature the installed MuJoCo expects. Older versions keep working, so the>=3.3.0floor stays.setup.py: the<3.10cap is gone.mj_fullMchange and the cap.tests/test_controllers/test_mass_matrix.py. It checks the controller's mass matrix against one built withmj_mulM, which works the same on every MuJoCo version.Verification
Quick check: