Repository navigation
Fix Newton cfgs cancelling inherited PhysX field routing - #6504
Closed
vidurv-nvidia wants to merge 1 commit into
Closed
vidurv-nvidia wants to merge 1 commit into
vidurv-nvidia wants to merge 1 commit into
Conversation
Seven Newton and MuJoCo schema cfg classes redeclared _usd_field_exceptions as an empty dict. Attribute lookup stops at the first class that defines it, so the redeclaration cancelled the base classes' routing of inherited PhysX-consumed fields. Setting disable_gravity, contact_offset, or rest_offset on those cfgs authored a bare physics attribute that no backend reads, and setting max_joint_velocity on the joint-drive cfgs made the writer raise because the declaring base class carries no namespace of its own. Remove the empty redeclarations so the base routing applies, matching the articulation-root cfg which already inherited it correctly, and leave a comment at each site explaining why the attribute must stay inherited. The regression tests set each affected field through the public writers and assert the PhysX-namespaced attribute is authored.
7 tasks done
Contributor
Author
|
Superseded by #7832, which re-derives this fix against current Confirmed the bug still reproduces before closing: the empty |
ooctipus
added a commit
that referenced
this pull request
Sep 20, 2026
# Description
Nine Newton schema config classes redeclare `_usd_field_exceptions:
ClassVar[dict] = {}`. The writer reads that table with a plain
`getattr`, so normal MRO lookup stops at the subclass's empty dict and
the inherited routing table is never consulted. The affected fields then
fall through to per-declaring-class routing and land in the *base*
namespace.
The user-visible result is a silently inert attribute. For example, a
Newton rigid-body cfg with `disable_gravity=True` authors:
```
physics:disableGravity = True <- no backend reads this
physxRigidBody:disableGravity = <unset> <- what should have been written
```
Gravity stays on. Same shape for `contact_offset` / `rest_offset` on the
collision cfgs. For `max_joint_velocity` it is louder — the writer
raises:
```
ValueError: JointDriveBaseCfg declares fields ['maxJointVelocity'] but does not define
'_usd_namespace'. Add '_usd_namespace' to the class metadata or route the fields via
'_usd_field_exceptions'.
```
Seven of the nine shadow a non-empty base table and are fixed here:
`NewtonRigidBodyPropertiesCfg`, `MujocoRigidBodyPropertiesCfg`,
`NewtonCollisionPropertiesCfg`, `NewtonMeshCollisionPropertiesCfg`,
`NewtonSDFCollisionPropertiesCfg`, `NewtonJointDrivePropertiesCfg`,
`MujocoJointDrivePropertiesCfg`.
The remaining two — `NewtonDeformableBodyPropertiesCfg` and
`NewtonMaterialPropertiesCfg` — are left alone deliberately: their bases
carry no routing table, so the empty redeclaration is currently inert.
It is the same latent footgun and worth a follow-up, but changing it
here would be a behavior change with no bug to point at.
Supersedes #6504, whose branch predates substantial changes to this
file.
## Type of change
- Bug fix (non-breaking change which fixes an issue)
## Testing
Routing coverage includes all seven affected config classes, including
the multiply inherited mesh config and angular joint-velocity
conversion. Four checks extend existing schema tests; one Newton
rigid-body test and a parametrized joint-drive test cover the remaining
classes.
- `test_newton_schemas.py`: **16 passed**.
- Restoring the seven empty routing dictionaries in memory makes **all
seven routing regression cases fail**; all seven pass with the fix.
- `uv run isaaclab -f`: passed.
Local validation used Isaac Sim 6.0.1.0, Newton 1.6.0rc1, and PyTorch
2.12.0; this does not replace CI against the pinned dependencies.
## Checklist
- [x] I have read and understood the contribution guidelines
- [x] I have run the `pre-commit` checks with `./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
---------
Co-authored-by: ooctipus <[email protected]>
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
Seven Newton/MuJoCo schema cfg classes redeclare
_usd_field_exceptions: ClassVar[dict] = {}. Python attribute lookup stops at the first class in the MRO that defines the attribute — even when the value is empty — so the redeclaration shadows the base classes' routing table for PhysX-consumed fields those classes inherit (disable_gravity,contact_offset,rest_offset,max_joint_velocity).Observed behavior on develop (verified by executing the writer per class/field):
NewtonRigidBodyPropertiesCfg,MujocoRigidBodyPropertiesCfgdisable_gravityphysics:disableGravity(no consumer)physxRigidBody:disableGravityNewtonCollisionPropertiesCfg+ Mesh/SDF subclassescontact_offset/rest_offsetphysics:*(no consumer)physxCollision:*NewtonJointDrivePropertiesCfg,MujocoJointDrivePropertiesCfgmax_joint_velocityValueErrorphysxJoint:maxJointVelocityThat the shadowing is accidental is shown by
NewtonArticulationRootPropertiesCfg, which does not redeclare the attribute and routes its inheritedarticulation_enabledtophysxArticulation:*correctly — one sibling inherited the pattern right, six copied boilerplate that cancels it.Fix
Remove the empty redeclarations from the seven classes so the base routing applies, with a comment at each site explaining why the attribute must stay inherited. No writer changes.
Tests
Six regression tests drive each affected field through the public writers (
define_rigid_body_properties,define_collision_properties,modify_joint_drive_properties) and assert the PhysX-namespaced attribute is authored (with the rad/s→deg conversion for the joint velocity) and no barephysics:*attribute appears. All fail before the fix (two with theValueError), pass after.test_newton_schemas.py25/26 and coretest_schemas.py40/40 locally — the one unrelated failure (test_newton_material_fragment_authors_all_six_newton_attrs) also fails on clean develop in this environment and appears to be resolver-key drift from the recent Newton bump; flagged separately.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/CONTRIBUTORS.mdor my name already exists there