You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MJX] accelerometer, framelinacc and frameangacc report -gravity on static and mocap bodies #3716
mj_objectAcceleration in mujoco c returns zero when the object's body is welded to a dof-less body (world, static or mocap). mjx reads cacc directly, and cacc[0] is -gravity, so accelerometer, framelinacc and frameangacc report 9.81 instead of 0.
this shows up in the menagerie: google_barkour_v0 has <accelerometer site="origin"/> on a worldbody site, and mjx reports [0, 0, 9.81] where mujoco reports [0, 0, 0].
I reran the six-sensor model on Linux CPU with JAX 0.12.0.1. The MuJoCo and MJX 3.17.0 wheels reproduced all four discrepancies. With both wheels at 4.0.0, all six sensors agreed within 4.2e-7.
I got the same result with the MJX Python source at a937a4f916dc586660145973b015e56e04043377 and the 4.0.0 native wheel. The four native readings that were zero in 3.17.0 now read +9.81 and agree with MJX. I used Codex to help run and check the comparison.
I also checked the unmodified Barkour v0 MJX scene in Menagerie at 98a70c56. On the paired 3.17.0 wheels, its world-origin accelerometer reproduced the report in both the default pose and the standing keyframe. With the current MJX source and native 4.0.0, both read [0, 0, +9.81] in both poses. I initialized the MJX sensor output to NaN before each forward pass to verify it was recomputed.
Applying just the production hunks from #3717 at e1f96e85 to current main made MJX read zero in both poses while native MuJoCo continued to read [0, 0, +9.81]. This comparison used current main with those hunks and the same release native engine.
Activity
yuvaltassa commentedon Nov 7, 2026
I think this is no longer true at head? please check
dhairyajangir commentedon Nov 10, 2026
I reran the six-sensor model on Linux CPU with JAX 0.12.0.1. The MuJoCo and MJX 3.17.0 wheels reproduced all four discrepancies. With both wheels at 4.0.0, all six sensors agreed within
4.2e-7.I got the same result with the MJX Python source at
a937a4f916dc586660145973b015e56e04043377and the 4.0.0 native wheel. The four native readings that were zero in 3.17.0 now read +9.81 and agree with MJX. I used Codex to help run and check the comparison.I also checked the unmodified Barkour v0 MJX scene in Menagerie at
98a70c56. On the paired 3.17.0 wheels, its world-origin accelerometer reproduced the report in both the default pose and thestandingkeyframe. With the current MJX source and native 4.0.0, both read[0, 0, +9.81]in both poses. I initialized the MJX sensor output to NaN before each forward pass to verify it was recomputed.Applying just the production hunks from #3717 at
e1f96e85to current main made MJX read zero in both poses while native MuJoCo continued to read[0, 0, +9.81]. This comparison used current main with those hunks and the same release native engine.