Repository navigation
[Fix] Build OVPhysX ContactSensor binding patterns per body so nested-hierarchy assets initialize - #6384
Merged
hujc7 merged 1 commit intoJul 16, 2026
Conversation
The contact-binding sensor patterns were built from the first matched body's parent plus leaf names. Bodies nested under other bodies (URDF importer output in Isaac Sim 6.0+) do not share a parent, so the constructed patterns named prims that do not exist, the binding bound only the first-level links, and initialization failed. Build each pattern from that body's own resolved path expression. The binding already receives one pattern per body, so the pattern-major data ordering is unchanged; body_names is stored from resolution and needs no change either. Also include the constructed patterns in the initialization error message.
hujc7
marked this pull request as ready for review
July 7, 2026 10:47
Contributor
AntoineRichard
approved these changes
Jul 16, 2026
matthewtrepte
pushed a commit
to matthewtrepte/IsaacLab
that referenced
this pull request
Aug 4, 2026
…-hierarchy assets initialize (isaac-sim#6384) # Description The OVPhysX `ContactSensor` fails to initialize on assets whose rigid bodies are nested (child link prims authored under their parent link prim, as produced by the URDF importer in Isaac Sim 6.0 and later). The contact-binding sensor patterns were built from the first matched body's parent plus leaf names: ``` bodies found (USD side): .../Robot/pelvis .../Robot/pelvis/left_hip .../Robot/pelvis/left_hip/left_knee patterns built: .../Robot/pelvis ← exists .../Robot/left_hip ← names a prim that does not exist .../Robot/left_knee ← names a prim that does not exist ``` Nested bodies do not share a parent, so the binding bound only the first-level links and initialization raised `Failed to initialize contact binding for specified bodies` (`sensor_count` not a multiple of the resolved body count). This is the OVPhysX counterpart of isaac-sim#6378 (PhysX, fixes isaac-sim#5126); verified by reproducing the pattern construction against a nested stage: 1/3 patterns name an existing prim before the fix, 3/3 after. ## Changes - Build each sensor pattern from that body's own resolved path expression (the per-body destination expressions `resolve_matching_prims_from_source` already returns) instead of a shared parent plus leaf names. - Unlike the PhysX fix, **no data-ordering changes are needed**: the binding already received one pattern per body (pattern-major ordering documented and tested in `test_multi_body_per_sensor_indexing`), and `body_names` is stored from resolution rather than derived from view paths. The single-body pose pattern reuses `sensor_patterns[0]`. - Include the constructed patterns in the initialization error message. - Regression test: kinematic chains with URDF-importer-style nested link prims authored directly under each environment prim, standalone sensor, asserting initialization succeeds (pre-fix: deterministic `RuntimeError`), exact body resolution and order, and data shape — at 1 and 3 environments on CPU and GPU. ## Verification status - **Root cause reproduced locally before fixing** (construction level): on a nested stage, the shipped pattern construction yields 1/3 patterns naming existing prims; the fixed construction yields 3/3. - **Both failure modes derived from the binding validation arithmetic**: a loud init `RuntimeError` when the body count does not divide the bound sensor count, and a silent env-count misinference (corrupted data shapes) when it does. The regression test is parametrized to catch both (1 and 3 envs). - **The `isaaclab_ovphysx` test suite does not execute on fork PRs** (`USE_OVPHYSX_WHEELHOUSE` is gated to same-repo branches), so the regression test in this PR runs on the first `develop` CI after merge and in the nightly compatibility workflow. A maintainer can run it pre-merge by pushing the branch to the upstream repo. Related to isaac-sim#5126 and isaac-sim#6378. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] 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 (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
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
The OVPhysX
ContactSensorfails to initialize on assets whose rigid bodies are nested (child link prims authored under their parent link prim, as produced by the URDF importer in Isaac Sim 6.0 and later). The contact-binding sensor patterns were built from the first matched body's parent plus leaf names:Nested bodies do not share a parent, so the binding bound only the first-level links and initialization raised
Failed to initialize contact binding for specified bodies(sensor_countnot a multiple of the resolved body count). This is the OVPhysX counterpart of #6378 (PhysX, fixes #5126); verified by reproducing the pattern construction against a nested stage: 1/3 patterns name an existing prim before the fix, 3/3 after.Changes
resolve_matching_prims_from_sourcealready returns) instead of a shared parent plus leaf names.test_multi_body_per_sensor_indexing), andbody_namesis stored from resolution rather than derived from view paths. The single-body pose pattern reusessensor_patterns[0].RuntimeError), exact body resolution and order, and data shape — at 1 and 3 environments on CPU and GPU.Verification status
RuntimeErrorwhen the body count does not divide the bound sensor count, and a silent env-count misinference (corrupted data shapes) when it does. The regression test is parametrized to catch both (1 and 3 envs).isaaclab_ovphysxtest suite does not execute on fork PRs (USE_OVPHYSX_WHEELHOUSEis gated to same-repo branches), so the regression test in this PR runs on the firstdevelopCI after merge and in the nightly compatibility workflow. A maintainer can run it pre-merge by pushing the branch to the upstream repo.Related to #5126 and #6378.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there