Skip to content

Add a MuJoCo group convention for workspace assets - #172

Open
siddhss5 wants to merge 3 commits into
mainfrom
mujoco-group-convention
Open

siddhss5 wants to merge 3 commits into
mainfrom
mujoco-group-convention

Conversation

@siddhss5

@siddhss5 siddhss5 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds one convention for MuJoCo geom and site groups across the workspace's asset models, plus a checker and an integration test that enforce it. Today groups are assigned ad hoc: robots follow MuJoCo Menagerie, but the ABH hands, every prl_assets object, and the sites of different robots disagree. So viewers show different kinds of content by default depending on which model loaded.

Changes

  • docs/mujoco-groups.md, the canonical convention, follows Menagerie and MuJoCo's default visibility (groups 0–2 shown):
    • Geoms:
      • 0: renders and collides (floors, tables, simple props).
      • 2: visual meshes.
      • 3: collision geometry, including physics-disabled safety and planning volumes.
      • 1, 4, 5: unused.
      • Collision geometry is hidden with group 3, not alpha 0, so toggling group 3 reveals it.
    • Sites:
      • 0: task frames (grasp, end-effector, tool tip, feeding target).
      • 4: engineering frames (attachment and mount points, F/T and IMU, camera frames, force pads, region markers).
    • A debug preset enables specific groups, for example {0, 1, 2, 4}, not all of them.
  • scripts/check_mujoco_groups.py MODEL.xml ... reports each geom and site that breaks the rules and exits non-zero. It reads what the convention can determine mechanically:
    • collision versus physics-disabled from contype/conaffinity;
    • "beside a visual mesh" per body;
    • resolved alpha, using MuJoCo's material rule;
    • site groups limited to {0, 4}.
  • tests/integration/test_mujoco_groups.py runs the checker on every model in geodude_assets, ada_assets, and prl_assets. Models that do not comply yet are strict expected failures linked to their issues. A fixed model therefore makes its entry fail until the entry is removed, so the list cannot go stale.
  • README links the convention.

Survey that motivated it

33 models were checked:

Content Usual group Exceptions
Robot visual meshes 2 ABH hands: 1
Robot collision geometry 3 none
prl_assets objects none everything in 0, collision proxies hidden with alpha 0
Sites none ADA all 0; Geodude/UR5e grasp 0, sensors and attachments 4; ABH 3; worktop 2

No code in mj_manipulator, geodude, ada_mj, ssrobot, or sscbirrt reads group numbers, so this changes only what viewers show.

Asset fixes (merged)

KNOWN_VIOLATIONS is now empty. It stays as the mechanism for any future non-compliant model.

Testing

Against the asset repos' current main, the integration test gives 26 passed (all models). Workspace Integration CI is red for reasons that predate this PR (#173). The new files pass ruff check and ruff format.

docs/mujoco-groups.md defines which geom and site groups hold visuals,
collision geometry, render-and-collide geometry, task frames, and
engineering frames, following MuJoCo Menagerie and MuJoCo's default
visibility (groups 0-2 shown). scripts/check_mujoco_groups.py reports
violations, and tests/integration/test_mujoco_groups.py runs it on every
model in geodude_assets, ada_assets, and prl_assets.
- Collision geometry must be hidden with group 3, not alpha 0, so a
  viewer's group-3 toggle can reveal it (as Menagerie robots do).
- Mark the models that do not comply yet as strict expected failures,
  linked to personalrobotics/geodude_assets#28 and
  personalrobotics/prl_assets#18. A fixed model makes its expected
  failure pass, which fails the suite until its entry is removed.
@siddhss5
siddhss5 marked this pull request as ready for review October 17, 2026 18:00
@siddhss5

Copy link
Copy Markdown
Collaborator Author

CI here is red for reasons that predate this PR: sscbirrt's tests are missing hypothesis, and the ada_mj and mj_viser gitlinks are stale. Both are tracked in #173, to be fixed after the asset group issues. The new test passes locally against the asset repos' main: 6 passed, 20 strict expected failures.

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