Skip to content

Preserve small MuJoCo semantics in USD decoder#3392

Open
LouRohanNV wants to merge 4 commits into
google-deepmind:mainfrom
LouRohanNV:roundtrip-pr/usd-decoder-small-preservation-fixes
Open

Preserve small MuJoCo semantics in USD decoder#3392
LouRohanNV wants to merge 4 commits into
google-deepmind:mainfrom
LouRohanNV:roundtrip-pr/usd-decoder-small-preservation-fixes

Conversation

@LouRohanNV

@LouRohanNV LouRohanNV commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR combines four small USD decoder preservation fixes:

  • Treat MjcSiteAPI prims as sites only, not both sites and visual geoms.
  • Initialize mjSpec::modelname from the USD stage/default prim when possible.
  • Only mark revolute/prismatic joints as MuJoCo-limited when finite lower/upper limits are authored.
  • Parse MjcCollisionAPI metadata on disabled colliders that are imported through the visual-geom path.

Fixes #3391

Why

These are narrow roundtrip-fidelity issues. They do not introduce new schema or change the broad USD import architecture, but they remove noisy and sometimes physics-relevant differences in compiled MuJoCo models.

Details

Sites

MjcSiteAPI prims can also be UsdGeomGprims for guide/visual purposes. The decoder should route them to the site list and avoid also treating them as visual geoms.

Model Name

The decoder now tries, in order:

  1. default prim display name
  2. default prim name
  3. root layer display name without extension

If none are available, the existing MuJoCo default remains unchanged.

Unlimited Joint Limits

The decoder now enables MuJoCo joint limits only when both lower and upper USD limit attributes are authored and not the unbounded fallback pair [-inf, inf].

Disabled Collider Metadata

If a disabled collider is routed through the visual path, it remains contact-disabled, but MuJoCo-specific metadata such as group is still decoded from MjcCollisionAPI.

USD / non-USD impact

The changes are contained to plugin/usd_decoder, which is only built when MUJOCO_WITH_USD=ON.

Validation

Each source branch built locally with:

cmake --build ./mujoco/build --target usd_decoder_plugin --parallel 8

Roundtrip fixture/model evidence from this repo:

  • Site double-decode count warnings disappear for models that author guide/site prims.
  • Root model names no longer become "MuJoCo Model" when a better USD name exists.
  • fixtures/unlimited_joint_limits.xml stops reporting limited: False != True.
  • Lite6 narrow's disabled gripper_lite_body.group metadata is preserved in the direct USD-imported MJB comparison.

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.

USD decoder does not preserve sites, model names, unlimited joints, and disabled-collider metadata

2 participants