Fix Newton self-collisions being uncontrolled via the deprecated PhysX cfg - #7164
Conversation
…X cfg ArticulationRootPropertiesCfg / PhysxArticulationRootPropertiesCfg's enabled_self_collisions field only authored physxArticulation:enabledSelfCollisions. Newton's schema resolver checks the native newton:selfCollisionEnabled attribute first and only falls back to the PhysX one when it's unauthored, so the deprecated cfg's setting never reached Newton simulations. modify_articulation_root_properties now mirrors the value onto newton:selfCollisionEnabled too. Also migrates the Allegro Hand, Shadow Hand, and Kuka Allegro configs (used by several Newton-default reorientation/handover tasks) from the deprecated cfg to explicit PhysxArticulationCfg + NewtonArticulationCfg fragments.
Greptile SummaryThe PR fixes deprecated self-collision configuration under Newton and migrates affected hand assets to backend-specific articulation fragments.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or non-blocking defects identified. The compatibility shim follows the established schema-authoring pattern, the fragment lists are supported by the spawner contract, and affected assets retain their prior PhysX settings while gaining an explicit Newton setting. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
C["Hand articulation configuration"] --> P["PhysxArticulationCfg"]
C --> N["NewtonArticulationCfg"]
P --> PA["physxArticulation:enabledSelfCollisions"]
N --> NA["newton:selfCollisionEnabled"]
L["Deprecated articulation configuration"] --> S["Compatibility shim"]
S --> PA
S --> NA
Reviews (1): Last reviewed commit: "Merge branch 'develop' into antoiner/fix..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The Newton compatibility fix is directionally correct, but the shared writer mirrors self-collision settings for every configuration exposing enabled_self_collisions, not only the deprecated compatibility configurations targeted by the PR.
- Design and architecture: The backend-agnostic writer now lets a non-deprecated
PhysxArticulationCfgauthor Newton schema state. This creates cross-backend coupling and makes conflicting PhysX/Newton fragments order-dependent. The compatibility mirror should be restricted to the deprecated configuration types. - API:
modify_articulation_root_propertiesgains broader behavior than documented: a PhysX-only fragment can applyNewtonArticulationRootAPIand setnewton:selfCollisionEnabled. The public asset fragment lists are otherwise a supported configuration form. - Implementation: The non-None guard, idempotent schema application, explicit attribute name, and regression assertion are appropriate. The type or configuration scope of the mirror must be narrowed so explicit backend fragments remain isolated and their values cannot overwrite one another based on ordering.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
|
|
||
| # backward-compat shim: mirror the deprecated PhysX-only 'enabled_self_collisions' onto | ||
| # 'newton:selfCollisionEnabled', which Newton checks before falling back to the PhysX attribute. | ||
| enabled_self_collisions = cfg_dict.get("enabled_self_collisions") |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Newton mirror also fires for PhysX fragment
The shim keys on the field name, not on the deprecated cfg type, so it also runs for the non-deprecated PhysxArticulationCfg fragment introduced here, stamping NewtonArticulationRootAPI and authoring newton:selfCollisionEnabled from a PhysX-namespaced cfg. With the new [PhysxArticulationCfg, NewtonArticulationCfg] list form the outcome becomes order-dependent whenever the two disagree (e.g. Newton self_collision_enabled=False silently overwritten). Gate the mirror on the deprecated cfg types only.
CORE_ISAACLAB_SUBMODULES installed isaaclab_assets before isaaclab_newton/isaaclab_physx, which it now depends on for the PhysxArticulationCfg/NewtonArticulationCfg fragment imports. Plain pip (used by isaaclab.sh) can't resolve those against the editable local sources out of order, so the install failed with "No matching distribution found for isaaclab_physx". Reordered the submodule list so the backend packages install first.
…ions' into antoiner/fix-newton-self-collisions
|
|
||
| # backward-compat shim: mirror the deprecated PhysX-only 'enabled_self_collisions' onto | ||
| # 'newton:selfCollisionEnabled', which Newton checks before falling back to the PhysX attribute. | ||
| enabled_self_collisions = cfg_dict.get("enabled_self_collisions") |
There was a problem hiding this comment.
I wonder would this not work if just delete it, the physx resolver should pick it up?
There was a problem hiding this comment.
PhysX picks it up, but newton does not, the issue is that if there is a newton authored property, then it takes precendence over the PhysX one.
| for prop in newton_properties: | ||
| if not prop.FlattenTo(parent_prim): | ||
| raise RuntimeError(f"Failed to move '{prop.GetPath()}' to '{parent_prim.GetPath()}'.") | ||
| for prop in newton_properties: |
There was a problem hiding this comment.
[P1] Avoid removing referenced property specs during relocation — With a standard UsdFileCfg reference, these Newton attributes are authored in the referenced layer. FlattenTo(parent_prim) succeeds, but articulation_prim.RemoveProperty(...) edits only the current target and returns false, so this block raises and aborts spawning. I reproduced this with public usd-core==25.11 and newton-usd-schemas==0.4.1. The shared PhysicsManager._relocate_articulation_root removes the applied schema but deliberately does not remove individual properties. Please reuse that helper or omit these removals and add a referenced-layer regression. Also account for raw apiSchemas metadata: before codeless registration, GetAppliedSchemas() hides the Newton token, which can leave it on the child and produce two roots when the stage is reopened with the schema registered.
|
|
||
| # Mirror after any root relocation so the Newton API does not recreate an articulation root | ||
| # on the former root link. | ||
| enabled_self_collisions = cfg_dict.get("enabled_self_collisions") |
There was a problem hiding this comment.
[P1] Do not overwrite an explicit Newton value from the supported PhysX cfg — This writer receives the non-deprecated PhysxArticulationRootPropertiesCfg as well as the deprecated alias. If an asset authors newton:selfCollisionEnabled=False, setting the PhysX field to true now silently replaces that Newton choice, although the class documents one cfg/namespace and NewtonArticulationRootPropertiesCfg owns the Newton side. Since the affected assets are already migrated to an explicit PhysX + Newton fragment pair, please either scope this compatibility mirror to the deprecated alias or document the supported PhysX cfg as dual-authoring and add a precedence regression.
| dependencies = [ | ||
| "isaaclab", | ||
| "isaaclab_contrib", | ||
| "isaaclab_physx", |
There was a problem hiding this comment.
[P2] Regenerate the lockfile for these package edges — The committed isaaclab-assets block in uv.lock still lists only isaaclab and isaaclab-contrib, so package-specific frozen sync/export metadata does not record these two new requirements. The branch and current develop both need a lock refresh, but these missing dependency edges are introduced here; please regenerate uv.lock (or coordinate the refresh with the current base).
| :data:`~isaaclab_assets.robots.allegro.ALLEGRO_HAND_CFG`, | ||
| :data:`~isaaclab_assets.robots.shadow_hand.SHADOW_HAND_CFG`, | ||
| :data:`~isaaclab_assets.robots.shadow_hand.SHADOW_HAND_NEWTON_CFG`, and | ||
| :data:`~isaaclab_assets.robots.kuka_allegro.KUKA_ALLEGRO_CFG`. Their ``articulation_props`` used |
There was a problem hiding this comment.
[P2] Document the public config-shape migration — These exported hand configs change spawn.articulation_props from a cfg object to a list. Downstream code that customizes them through cfg.spawn.articulation_props.enabled_self_collisions = ... now raises AttributeError. The fragment pair is the intended abstraction, but the changelog should mark the shape change and show how to update or replace the appropriate fragment.
marcodiiga
left a comment
There was a problem hiding this comment.
Reviewed current head 01257e8. No P0 or critical release blocker found, so approving. The PhysX + Newton fragment pair is the repository’s intended extensible abstraction: subclasses are accepted and each fragment writes an isolated namespace. The Newton schema is supplied by the existing Apache-2.0 codeless newton-usd-schemas package; this PR embeds no schema code or data. I left actionable comments for referenced/unregistered-schema relocation, mirror scope, lock metadata, and migration guidance. The tests verify USD authoring and root placement; an end-to-end Newton collision assertion remains worthwhile.
…X cfg (#7164) (#7217) ## Summary Backports #7164 to `release/3.0.0`. - Mirrors deprecated PhysX self-collision configuration to the Newton articulation-root schema. - Migrates the Allegro Hand, Shadow Hand, and Kuka Allegro configs to explicit PhysX and Newton articulation fragments. - Declares the backend package dependencies required by `isaaclab_assets` and fixes core package installation order. - Preserves a single articulation root during fixed-root relocation, including pre-authored Newton schema state. - Initializes the kitless benchmark articulation consistently with production articulation objects. The backport is patch-identical to the merged #7164 diff and contains no unrelated `develop` history. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Test plan - [x] `source/isaaclab/test/sim/test_schemas.py`: 44 passed - [x] Kitless benchmark semantics: 18 passed - [x] PhysX fixed-base initialization: 4 passed - [x] Newton fixed-base initialization: 4 passed - [x] Install command parsing: 57 passed - [x] `uv run isaaclab -f` - [x] Changelog fragment validation against `release/3.0.0` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] My changes generate no new warnings - [x] I have added tests that prove the fix is effective - [x] I have added changelog fragments for every touched package - [x] My name already exists in `CONTRIBUTORS.md` Co-authored-by: Kelly Guo <kellyg@nvidia.com>
Summary
ArticulationRootPropertiesCfg/PhysxArticulationRootPropertiesCfg.enabled_self_collisionsonly authoredphysxArticulation:enabledSelfCollisions. Newton's schema resolver checksnewton:selfCollisionEnabledfirst and only falls back to the PhysX attribute when it's unauthored, so the deprecated cfg's setting silently never reached Newton simulations.modify_articulation_root_propertiesnow mirrorsenabled_self_collisionsontonewton:selfCollisionEnabled(applyingNewtonArticulationRootAPI) whenever it's set, so the deprecated cfg controls self-collisions on both backends.ALLEGRO_HAND_CFG,SHADOW_HAND_CFG,SHADOW_HAND_NEWTON_CFG, andKUKA_ALLEGRO_CFGoff the deprecated cfg to explicitPhysxArticulationCfg+NewtonArticulationCfgfragments. Several of the reorientation/handover tasks built on these hands (Isaac-Reorient-Cube-Allegro*,Isaac-Reorient-Cube-Shadow-Direct*,Isaac-Shadow-Handover-Direct) default to thenewton_mjwarppreset, so this was a real training-time gap, not just a hypothetical one.isaaclab_physx/isaaclab_newtonas declared dependencies ofisaaclab_assets(needed for the fragment imports above).Test plan
test_physx_articulation_root_writes_self_collisionsextended to assertnewton:selfCollisionEnabled/NewtonArticulationRootAPIare authored; confirmed it fails without the fix and passes with it.source/isaaclab/test/sim/test_schemas.py(43 tests) andtest_articulation_fragments.py(26 tests) pass.source/isaaclab_assetstest suite passes (test_asset_configsloads all three migrated robot configs).test_initialization_hand_with_tendons(Shadow Hand, PhysX backend) passes with the fragment-basedarticulation_props.uv run isaaclab -fpasses (formatting, changelog fragments).