-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Adding Articulation Root USD data classes and writers #6272
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
1e04efb
064ba8e
af0c392
e80c7aa
3fa37b8
6892d5d
5dbbc2b
12852bc
f1892ef
45165ab
6a0775e
44d5e35
4b381e6
5137c59
7989544
aae4918
62f98e0
c15dde1
b0dcdd8
4dc87bb
3b9cf1c
30f06c4
d55e0ed
9b2cb9e
0d4b413
7774ba3
280c20a
3ec6dae
f6fd754
10ecaf9
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,22 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added the articulation-root schema-fragment API: | ||
| :class:`~isaaclab.sim.schemas.ArticulationRootFragment` (marker) and | ||
| :func:`~isaaclab.sim.schemas.apply_articulation_root_properties`, which applies a list of | ||
| articulation-root fragments with ``UsdPhysics.ArticulationRootAPI`` as a presence-gated anchor | ||
| and reproduces the legacy ``fix_root_link`` fixed-joint logic via a spawner-level flag. | ||
| * Added the :meth:`~isaaclab.physics.PhysicsManager.fix_articulation_root` capability, which fixes an | ||
| articulation base to the world frame and returns the resulting root prim. The base implementation | ||
| authors a backend-neutral fixed joint; backends whose parser relocates the articulation root (e.g. | ||
| PhysX) override it, so :func:`~isaaclab.sim.schemas.apply_articulation_root_properties` applies every | ||
| fragment to the single resulting root regardless of backend. | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * Changed the spawner ``articulation_props`` slot | ||
| (:attr:`~isaaclab.sim.spawners.UsdFileCfg.articulation_props`) to also accept a list of | ||
| :class:`~isaaclab.sim.schemas.ArticulationRootFragment` fragments, and added the spawner-level | ||
| :attr:`~isaaclab.sim.spawners.UsdFileCfg.fix_root_link` flag. Legacy single cfgs continue to | ||
| work through a transition bridge in the spawn writer. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -369,8 +369,36 @@ def _spawn_from_usd_file( | |
| schemas.modify_mass_properties(prim_path, cfg.mass_props) | ||
|
|
||
| # modify articulation root properties | ||
| if cfg.articulation_props is not None: | ||
| schemas.modify_articulation_root_properties(prim_path, cfg.articulation_props) | ||
| # ``fix_root_link`` is a spawner-level topology flag (not a schema property); it is honored on the | ||
| # fragment path independently of whether any articulation schema properties were supplied. | ||
| articulation_props = cfg.articulation_props | ||
| articulation_fix_root_link = cfg.fix_root_link | ||
| # transition shim, remove later: route a legacy single cfg (a dataclass, not a fragment) to the | ||
| # legacy writer -- it owns its own ``fix_root_link`` field; everything else goes to the fragment | ||
| # writer, routing by type so an empty list is still a valid (topology-only) fragment collection | ||
| # rather than being mis-sent to the legacy writer. | ||
| if ( | ||
| articulation_props is not None | ||
| and not isinstance(articulation_props, (list, tuple)) | ||
| and not isinstance(articulation_props, schemas.SchemaFragment) | ||
| ): | ||
| if articulation_fix_root_link is not None: | ||
| logger.warning( | ||
| f"Ignoring the spawner-level 'fix_root_link={articulation_fix_root_link}' because" | ||
| " 'articulation_props' is a legacy cfg, which owns its own 'fix_root_link' field. Set" | ||
| " it on that cfg instead." | ||
| ) | ||
| schemas.modify_articulation_root_properties(prim_path, articulation_props) | ||
|
Collaborator
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. Blocking for the advertised legacy transition: This breaks the base-field-through-backend-subclass invariant established in the same author's merged #5275. Please inherit/merge the base exception mapping and add a regression comparing this legacy cfg with the equivalent PhysX + Newton fragment list. |
||
| else: | ||
| articulation_frags = ( | ||
| list(articulation_props) | ||
| if isinstance(articulation_props, (list, tuple)) | ||
| else ([articulation_props] if isinstance(articulation_props, schemas.SchemaFragment) else []) | ||
| ) | ||
| if articulation_frags or articulation_fix_root_link is not None: | ||
| schemas.apply_articulation_root_properties( | ||
| prim_path, articulation_frags, fix_root_link=articulation_fix_root_link | ||
| ) | ||
| # modify tendon properties | ||
| if cfg.fixed_tendons_props is not None: | ||
| # transition shim, remove later: fragment(s) -> apply_*; legacy cfg -> modify_* | ||
|
|
||
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.
Raisessection is incomplete. Whenfix_root_link=Trueand no creator has been registered (i.e.isaaclab_physxwas never imported), the function raisesRuntimeError, not one of the two documented exceptions. A caller who catches onlyValueError/NotImplementedErrorwill get an unexpected uncaught exception.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.
Addressed in b0dcdd8. The per-backend "no creator registered" case is gone with the registry; the remaining
RuntimeErroris raised only when a fixed joint must be created but there is no activeSimulationContextto resolve the backend from, and theRaisessection now documents exactly that plus the propagatedNotImplementedError.