Skip to content

Fix PhysX scene data rigid body view - #5804

Merged
kellyguo11 merged 1 commit into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-physx-scene-data-rigid-body-view
May 27, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-physx-scene-data-rigid-body-view

Conversation

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Description

Fixes a spurious PhysX tensor warning when the Newton visualizer requests scene-data transforms for assets whose joint prims share names with rigid-body prims, such as Ant and Humanoid.

The PhysX scene-data backend already discovers exact rigid-body prims from USD, so this change creates the rigid-body view from those exact paths instead of broad /World/envs/env_* wildcard patterns that can also match same-named joint prims.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Not applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • 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)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Manual verification:

  • ./isaaclab.sh -f
  • timeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py --task Isaac-Ant-v0 --num_envs 128 --viz newton presets=physx
  • timeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py --task Isaac-Humanoid-v0 --num_envs 128 --viz newton presets=physx

The Ant and Humanoid repro commands start without the previous [omni.physx.tensors.plugin] Failed to find rigid body at .../Robot/joints/... warnings.

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels May 27, 2026
@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes spurious [omni.physx.tensors.plugin] Failed to find rigid body at ... warnings that appear when the Newton visualizer queries scene-data transforms for assets like Ant and Humanoid, whose joint prim names overlap with rigid-body prim names. The root cause was that the previous wildcard-based create_rigid_body_view call could resolve to joint prims that are not rigid bodies.

  • Core fix (physx_manager.py): get_rigid_body_view() now gathers exact prim paths via stage.Traverse() filtered by UsdPhysics.RigidBodyAPI and passes those directly to create_rigid_body_view, eliminating false matches on same-named joint prims.
  • Changelog (changelog.d/scene-data-rigid-body-view.rst): Correctly describes the fix in the Fixed section.

Confidence Score: 4/5

Safe to merge for typical simulation scales; the exact-path approach correctly avoids matching joint prims and eliminates the spurious PhysX warnings.

The fix is logically sound and the manual test commands confirm the warnings disappear for Ant and Humanoid. The only concern is that for very large environment counts, passing one explicit path per rigid body instance rather than one wildcard pattern per body type could add noticeable overhead at scene startup.

source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py - the scalability trade-off in get_rigid_body_view() is worth revisiting if this code path is exercised with very large environment counts.

Important Files Changed

Filename Overview
source/isaaclab_physx/isaaclab_physx/physics/physx_manager.py Fixes get_rigid_body_view() to collect exact rigid-body prim paths instead of converting per-env paths to wildcard patterns; avoids spurious PhysX warnings for joint prims that share names with rigid-body prims. Minor scalability trade-off: produces O(num_envs x bodies_per_env) explicit paths instead of O(unique_body_types) wildcard patterns.
source/isaaclab_physx/changelog.d/scene-data-rigid-body-view.rst New changelog fragment describing the rigid-body view fix; correctly placed and accurately describes the change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[get_rigid_body_view called] --> B{_rigid_body_view cached?}
    B -- yes --> C[return cached view]
    B -- no --> D{_simulation_view set?}
    D -- no --> E[return None]
    D -- yes --> F[get USD stage]
    F --> G{stage valid?}
    G -- no --> E
    G -- yes --> H[Traverse all prims]
    H --> I{prim has RigidBodyAPI?}
    I -- no --> H
    I -- yes --> J[append exact prim path to list]
    J --> H
    H -- done --> K{paths list empty?}
    K -- yes --> E
    K -- no --> L[create_rigid_body_view with exact paths]
    L --> M[cache as _rigid_body_view]
    M --> C
Loading

Reviews (1): Last reviewed commit: "Fix PhysX scene data rigid body view" | Re-trigger Greptile

Comment on lines +189 to +197
paths: list[str] = []
for prim in stage.Traverse():
if prim.HasAPI(UsdPhysics.RigidBodyAPI):
patterns.add(re.sub(r"/World/envs/env_\d+", "/World/envs/env_*", prim.GetPath().pathString))
paths.append(prim.GetPath().pathString)

if not patterns:
if not paths:
return None

self._rigid_body_view = self._simulation_view.create_rigid_body_view(list(patterns))
self._rigid_body_view = self._simulation_view.create_rigid_body_view(paths)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 View creation may scale poorly for large environment counts

The old approach collapsed all per-environment instances down to O(unique_body_types) wildcard patterns (e.g., /World/envs/env_*/Robot/torso) via a set. The new approach collects O(num_envs × bodies_per_env) explicit paths. At 128 environments this is invisible, but Isaac Lab RL workloads frequently run 10k–100k environments, which would produce hundreds of thousands of path strings passed as a Python list into create_rigid_body_view. That could add measurable Python-side overhead at scene startup and consume significantly more memory for the path list itself.

Consider keeping the exact-path traversal (correct for avoiding the joint-prim mismatch) but deduplicating by substituting only the numeric environment index with a wildcard after confirming the prim has RigidBodyAPI — identical to the old logic, but limited to prims that genuinely carry the API.

@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

@matthewtrepte could you take a quick look to validate?

@kellyguo11
kellyguo11 merged commit 142aa32 into isaac-sim:develop May 27, 2026
37 checks passed
kellyguo11 pushed a commit to kellyguo11/IsaacLab-public that referenced this pull request May 27, 2026
# Description

Fixes a spurious PhysX tensor warning when the Newton visualizer
requests scene-data transforms for assets whose joint prims share names
with rigid-body prims, such as Ant and Humanoid.

The PhysX scene-data backend already discovers exact rigid-body prims
from USD, so this change creates the rigid-body view from those exact
paths instead of broad `/World/envs/env_*` wildcard patterns that can
also match same-named joint prims.

Fixes # (issue)

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Not applicable.

## 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`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] 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

Manual verification:

- `./isaaclab.sh -f`
- `timeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py
--task Isaac-Ant-v0 --num_envs 128 --viz newton presets=physx`
- `timeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py
--task Isaac-Humanoid-v0 --num_envs 128 --viz newton presets=physx`

The Ant and Humanoid repro commands start without the previous
`[omni.physx.tensors.plugin] Failed to find rigid body at
.../Robot/joints/...` warnings.
kellyguo11 added a commit that referenced this pull request May 28, 2026
… locomanip quaternion, deformable demo, IK, benchmark scripts (#5816)

# Description

Cherry pick following PRs from develop:

- #5779 
- #5760
- #5791
- #5810 
- #5811
- #5812 
- #5754 
- #5802 
- #5803 
- #5782
- #5804 
- #5744 
- #5775 
- #5784

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: John <[email protected]>
Co-authored-by: myurasov-nv <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
Co-authored-by: Mike Yan Michelis <[email protected]>
Co-authored-by: hujc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants