[BUG FIX] Apply the per-geom density in MJCF asset. - #3269
Draft
Milotrince wants to merge 5 commits into
Draft
Conversation
Milotrince
force-pushed
the
mjcf-geom-density
branch
from
August 25, 2026 03:38
588256b to
ea8ed42
Compare
Member
Author
|
@codex review |
Milotrince
force-pushed
the
mjcf-geom-density
branch
from
August 25, 2026 04:09
ea8ed42 to
530faf4
Compare
|
🔴 Benchmark Regression Detected ➡️ Report |
Milotrince
force-pushed
the
mjcf-geom-density
branch
from
August 25, 2026 19:38
d9be3d5 to
530faf4
Compare
duburcqa
reviewed
Aug 28, 2026
Comment on lines
1009
to
1011
| # and estimated masses would make the anchor density-dependent, and a kinematic entity has no density | ||
| # to fall back on, so alignment could differ from the rigid counterpart. Require all-or-none and raise | ||
| # otherwise. |
Collaborator
There was a problem hiding this comment.
Make sure to update the comment accordingly.
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.
Description
densityandmassfrom MJCF geomfor a link with no collision geometry.
so a link mixing stated and unstated geoms anchors at the right relative weights instead of
being rejected as ambiguous.
With
recompute_inertia=Truethis PR affects assets that author the Gym-styledensity="5":xml/ant.xml97.33 -> 0.324 kg (Mujoco: 0.327),xml/one_tet.xml1600 -> 13.3,xml/thin_box.xml0.0096 -> 8e-05. Default options are unaffected: link masses are same on MJCFs withrecompute_inertia=False.Related Issue
Motivation and Context
An asset that states what its geoms are made of should be weighed by it whenever Genesis computes the mass itself.
How Has This Been / Can This Be Tested?
tests/rigid tests/parserstests/rigid/test_asset_loading.py::test_mjcf_authored_geom_densityChecklist:
Submitting Code Changessection of CONTRIBUTING document.