Preserve small MuJoCo semantics in USD decoder#3392
Open
LouRohanNV wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR combines four small USD decoder preservation fixes:
MjcSiteAPIprims as sites only, not both sites and visual geoms.mjSpec::modelnamefrom the USD stage/default prim when possible.MjcCollisionAPImetadata 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
MjcSiteAPIprims can also beUsdGeomGprims 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:
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
groupis still decoded fromMjcCollisionAPI.USD / non-USD impact
The changes are contained to
plugin/usd_decoder, which is only built whenMUJOCO_WITH_USD=ON.Validation
Each source branch built locally with:
Roundtrip fixture/model evidence from this repo:
"MuJoCo Model"when a better USD name exists.fixtures/unlimited_joint_limits.xmlstops reportinglimited: False != True.gripper_lite_body.groupmetadata is preserved in the direct USD-imported MJB comparison.