feat(schemas): articulation-root schema-fragment API (additive)#7
Draft
vidurv-nvidia wants to merge 6 commits into
Draft
feat(schemas): articulation-root schema-fragment API (additive)#7vidurv-nvidia wants to merge 6 commits into
vidurv-nvidia wants to merge 6 commits into
Conversation
apply_articulation_root_properties applied UsdPhysics.ArticulationRootAPI unconditionally on the input prim. USD assets author the root on a child prim (the root link / fixed joint), so this stamped a SECOND root on the top prim and wrote the fragment properties + fix_root_link logic to the wrong prim -- a duplicate root that also violates the single-root asset requirement. Descend the subtree to the existing root and tune it in place (matching the legacy @apply_nested modify_articulation_root_properties writer); only define a fresh root on the input prim when the subtree has none (primitive or programmatic spawns). Fragments and the fix_root_link reparent logic now target the resolved root. Also guard an invalid input prim path. Add a regression test covering the child-root case (verified to fail before the fix).
Replace the hand-rolled subtree BFS with the existing get_first_matching_child_prim query helper (predicate = HasAPI(ArticulationRootAPI)). Same find-or-define behavior; the helper also validates the path, so the bespoke helper and the separate IsValid guard are dropped. Pass traverse_instance_prims=False to keep parity with the legacy @apply_nested writer, which does not author through instances.
The function docstring already explains the find-or-define rationale, so collapse the inline comments to terse intent. The fix_root_link block is left untouched -- it is reproduced verbatim from the legacy writer.
The create-new-joint branch of apply_articulation_root_properties was sim-unexercised (only the toggle-existing-joint case was tested). Add two tests: (1) fix_root_link=True with no existing joint creates a fixed joint and reparents the articulation root from the rigid-body root link to its parent; (2) fix_root_link=True on a non-rigid-body root raises NotImplementedError.
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
Additive articulation-root fragment family
PhysxArticulationCfg(physxArticulation:*: solver iters, sleep/stabilization,enabled_self_collisions,articulation_enabled)NewtonArticulationCfg(newton:selfCollisionEnabled)apply_articulation_root_properties(...): anchorArticulationRootAPIpresence-gated;fix_root_linkis a spawner-level flag (not a fragment field).fix_root_linkfixed-joint logic was copied from the legacy writer; the create-new-joint branch is not unit-tested (needs Isaac Sim). New path is single-prim (not@apply_nestedlike legacy). Status: authored, ruff clean, sim verification pending.Fixes # (N/A — part of the staged physics schema-fragment refactor; no tracked public issue)
Type of change
Screenshots
N/A — no user-facing visual changes.
Checklist
ruff+ruff-format) on the changed files./isaaclab.sh -d; not separately authored)source/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.md