Repository navigation
Match Newton rigid object collection bodies exactly - #8175
Conversation
The Newton RigidObjectCollection merged the members' prim path expressions into one glob by wildcarding the differing part of each path segment. The merged glob also matched other rigid bodies whose names share the members' prefix and suffix, which failed the per-world count check, and it could not be built at all when members sit at different depths below the environment. Pass the list of member expressions to ArticulationView, which matches each label against the list, so the view binds exactly the configured prims, as the PhysX collection already does. Signed-off-by: Yusuf Guenena <[email protected]>
|
run-ci |
|
| (("Object_A", "Object_B"), ("Object_Target",)), | ||
| # members at different depths below the environment | ||
| (("Object_A", "Shelf/Object_B"), ()), |
There was a problem hiding this comment.
Member ordering remains untested. Both new cases configure
Object_A before Object_B, so the pose checks cannot catch a mismatch between body names and view slots when configuration order differs from path order. Add a reversed-order case with distinct poses; otherwise this regression test could miss incorrect reads or writes for those configurations.
Knowledge Base Used: Newton backend
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!
There was a problem hiding this comment.
Isaac Lab Review Bot
The change replaces Newton’s approximate combined wildcard with the ordered list of configured rigid-body globs, preserving count validation and adding focused regressions for prefix collisions and mixed hierarchy depths. No blocking issues were identified.
- Design and architecture: The exact-match behavior remains localized to the Newton
RigidObjectCollectioninitialization boundary. Removing_build_combined_patternand its unusedosimport eliminates the obsolete workaround, while the existing per-world count validation remains the single guard against aliased or otherwise incomplete member bindings. - API: The public
RigidObjectCollectionsurface remains unchanged: configuration, body-name ordering,root_view,num_instances, andfind_bodiescontinue through the same paths. The deleted_build_combined_patternmethod is private, and no supplied consumer depends on it. - Compatibility and deprecation: Breaking changes: none identified. Mixed-depth member paths become newly supported, exact configured paths no longer over-match similarly named bodies, and aliased paths still fail through the retained count check. The
RuntimeErrorwording changes, but no supplied caller or test relies on the previous text. - Implementation: Initialization still resolves exactly one rigid-body expression per configured member, converts each expression with
path_expr_to_glob, and preserves configuration order alongside_body_names_list. Passing that ordered list directly to Newton’sArticulationViewremoves the lossy merge, whilecount_per_world != num_bodiescontinues to reject short or excessive bindings. - Style consistency: The implementation follows adjacent structure and naming, removes dead code rather than retaining an unused helper, and keeps comments concise. The changelog fragment uses the package’s expected
Fixedformat, and the CONTRIBUTORS entry remains alphabetically placed. - Test quality: The changed test file adds
test_collection_binds_only_configured_prims, with separate rows for the two distinct regressions: a similarly prefixed unconfigured sibling and configured members at different depths. It checks both total binding count and each named body’s observable pose, uses distinct positions to catch ordering or binding mistakes, and scopes the device throughtest_devices(DeviceScope.CUDA)without duplicating a backend-independent device matrix.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
Description
The Newton
RigidObjectCollectionmerged its members' prim path expressions into one wildcard glob (_build_combined_pattern), because older Newton could not accept a list of patterns. That approximation has two failures:Object_AandObject_B, the glob/World/Env_*/Object_*also selects an unrelatedObject_Targetin the same environment, and initialization fails withRuntimeError: ... matched 3 objects per world, but the collection config contains 2.Object_AandShelf/Object_Bfail withValueError: Cannot build combined pattern: path expressions have different segment counts.Newton 1.6.0, the pinned version, accepts the individual patterns:
ArticulationViewmatches each label against a list of globs. This PR passes the members' patterns directly, as suggested in #6147, and removes the obsolete wildcard-merging workaround. This matches the PhysX collection, which already passes the list tocreate_rigid_body_view.The per-world count check is kept. Newton matches each body once, so two members whose prim paths resolve to the same prim produce one match per world. Without the check, a 4-environment scene with such an aliased pair initializes without error, but it reports
num_instances=2and a pose buffer of shape(4, 1, 3). With the check, it raises a clear error.Fixes #6147
Type of change
Test
Extended the existing Newton
test_initializationinsource/isaaclab_newton/test/assets/test_rigid_object_collection.py; no separate regression test or fixture was added. The cases cover a single member, an unrelatedObject_TargetalongsideObject_A/B/C, and members at different depths (Object_AandShelf/Object_B). All run on CPU and CUDA and check each body's name-to-pose mapping as well as view counts and buffer shapes.The two regression cases fail against the original implementation at
eb6617cdaand pass with the fix.Local collection-suite validation:
Separate local cross-backend checks also passed both path cases on each backend, including targeted pose writes, stepping, and reset. The consolidated Newton suite was rerun after the test cleanup; the PhysX and OVPhysX implementations were unchanged.
uv run --no-sync isaaclab -fpassed, including the changelog check.Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions; CI handles that)CONTRIBUTORS.mdor my name already exists there