-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Adding Mass USD data classes and writers #6263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b07d309
66ab3d0
6a1f55f
f2099c0
1cc1dbc
337b4cf
3e18cef
28e53b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added the mass schema-fragment API: the :class:`~isaaclab.sim.schemas.MassFragment` marker and | ||
| :class:`~isaaclab.sim.schemas.MassCfg` (writes ``physics:mass`` / ``physics:density`` via | ||
| ``UsdPhysics.MassAPI``). The legacy :class:`~isaaclab.sim.schemas.MassPropertiesCfg` remains the | ||
| canonical name and continues to work unchanged. | ||
| * Added :func:`~isaaclab.sim.schemas.apply_mass_properties`, which applies a list of mass fragments | ||
| with ``UsdPhysics.MassAPI`` as the implicit anchor. | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * Changed the spawner ``mass_props`` slot | ||
| (:attr:`~isaaclab.sim.spawners.RigidObjectSpawnerCfg.mass_props`) to also accept a single | ||
| :class:`~isaaclab.sim.schemas.MassFragment` or a list of them. Legacy | ||
| :class:`~isaaclab.sim.schemas.MassPropertiesCfg` cfgs continue to work through a transition bridge | ||
| in the spawn writers. | ||
|
|
||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed :func:`~isaaclab.sim.schemas.apply_mass_properties` to raise ``ValueError`` on an invalid | ||
| prim path and to aggregate per-fragment results instead of always returning ``True``, matching | ||
| :func:`~isaaclab.sim.schemas.apply_rigid_body_properties`. | ||
| * Fixed the spawn writers so an empty ``mass_props`` list is a harmless no-op rather than being | ||
| forwarded to :func:`~isaaclab.sim.schemas.define_mass_properties` as an unexpected list. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,8 +82,14 @@ class RigidObjectSpawnerCfg(SpawnerCfg): | |
| to the prim outside of the properties available by default when spawning the prim. | ||
| """ | ||
|
|
||
| mass_props: schemas.MassPropertiesCfg | None = None | ||
| """Mass properties.""" | ||
| mass_props: schemas.MassPropertiesCfg | schemas.MassFragment | list[schemas.MassFragment] | None = None | ||
| """Mass properties. | ||
|
|
||
| Accepts either a single legacy :class:`~isaaclab.sim.schemas.MassPropertiesCfg` or a list of | ||
| :class:`~isaaclab.sim.schemas.MassFragment` fragments (e.g. ``[MassCfg(...)]``). When a fragment | ||
| list is given, ``UsdPhysics.MassAPI`` is applied as the implicit anchor and each fragment writes | ||
| its own namespace. | ||
| """ | ||
|
|
||
| rigid_props: schemas.RigidBodyBaseCfg | schemas.RigidBodyFragment | list[schemas.RigidBodyFragment] | None = None | ||
| """Rigid body properties. | ||
|
Comment on lines
83
to
95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The type annotation adds Fix: either drop |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notefor themassfield is ambiguous: "If non-zero, the mass is ignored" leaves "non-zero" unspecified (does it refer to mass or density?). The USD physics rule is that a non-zerodensitytakes precedence and is used to derive mass. The same ambiguous note exists inMassPropertiesCfgbut is copied here as-is.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!