Skip to content

Fix ArticulatedDevice unnamed joints and joint_range shapes - #15

Open
M-Colley wants to merge 1 commit into
google-deepmind:mainfrom
M-Colley:fix/articulated-device-freejoints
Open

M-Colley wants to merge 1 commit into
google-deepmind:mainfrom
M-Colley:fix/articulated-device-freejoints

Conversation

@M-Colley

Copy link
Copy Markdown

Summary

Fix two ArticulatedDevice issues affecting floating-base (<freejoint/>), ball-joint, and single-joint models:

  • Retain unnamed joints (such as <freejoint/>) when joint_names=None in ArticulatedDevice.initialize() (list(mj_spec.joints) instead of filtering on if j.name, since BoundDataAccessor / BoundModelAccessor bind by spec.id).
  • Declare "joint_range" spec shape as (len(self._joints), 2) instead of (qpos_size, 2) (matching MuJoCo's (njnt, 2) jnt_range layout for free and ball joints) and reshape bound_model.range to (simulator.nworld, len(self._joints), 2) so single-joint models do not collapse the joint dimension to (nworld, 2).

Testing

  • Added parameterized Impl.CPP and Impl.WARP tests in articulated_device_test.py verifying unnamed <freejoint/> + hinge DeviceLayer spec/measurement shapes and single-joint joint_range shape (nworld, 1, 2).
  • Ran pyink --check, isort --check, pyrefly check, and pytest reaf/simulation/torch/_src/common/ reaf/simulation/torch/_src/builders/ (326 passed).

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