Skip to content

Fix MJX forward, passive, and sensor parity with native MuJoCo - #3440

Open
Ayush7614 wants to merge 1 commit into
google-deepmind:mainfrom
Ayush7614:fix/mjx-forward-passive-sensor-parity
Open

Fix MJX forward, passive, and sensor parity with native MuJoCo#3440
Ayush7614 wants to merge 1 commit into
google-deepmind:mainfrom
Ayush7614:fix/mjx-forward-passive-sensor-parity

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Run acceleration-stage sensors even when efc_J is empty (constraint-free models), matching native mj_forward.
  • Treat spring/damper disable flags independently (AND, not OR) so disabling springs still leaves damping, gravcomp, and fluid forces.
  • When actuation is disabled, zero actuator_velocity and actuator_force (not only qfrc_actuator).
  • Apply cutoff to FRAMELINACC / FRAMEANGACC; handle empty contact capacity for touch/contact sensors; use a sign-preserving near-zero denominator guard in camprojection.

These are standalone correctness gaps (not tied to an existing issue). Each change was reproduced against native MuJoCo and covered by new parity tests.

Test plan

  • python -m mujoco.mjx._src.forward_test ForwardTest.test_constraint_free_actuatorfrc_sensor ForwardTest.test_disable_actuation_zeros_actuator_velocity
  • python -m mujoco.mjx._src.passive_test PassiveTest.test_disable_spring_keeps_damper
  • python -m mujoco.mjx._src.sensor_test SensorTest.test_framelinacc_cutoff SensorTest.test_touch_with_empty_contact_capacity SensorTest.test_camprojection_near_camera_plane
  • CI MJX suite on this PR

@google-cla

google-cla Bot commented Jul 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Constraint-free models now still evaluate acceleration-stage sensors;
spring/damper disable flags are independent; actuation disable clears
actuator velocity/force; frame-acceleration applies cutoff; empty
contact capacity no longer crashes touch/contact sensors; and
camprojection uses a sign-preserving near-zero denominator guard.
@Ayush7614
Ayush7614 force-pushed the fix/mjx-forward-passive-sensor-parity branch from 2208f4f to d83bd88 Compare July 28, 2026 21:47
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.

1 participant