Repository navigation
Fix PhysX scene data rigid body view - #5804
kellyguo11 merged 1 commit into
Conversation
Greptile SummaryThis PR fixes spurious
Confidence Score: 4/5Safe 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
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
Reviews (1): Last reviewed commit: "Fix PhysX scene data rigid body view" | Re-trigger Greptile |
| 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) |
There was a problem hiding this comment.
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.
|
@matthewtrepte could you take a quick look to validate? |
# 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.
… 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]>
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
Screenshots
Not applicable.
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 thereManual verification:
./isaaclab.sh -ftimeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py --task Isaac-Ant-v0 --num_envs 128 --viz newton presets=physxtimeout 60s ./isaaclab.sh -p scripts/environments/zero_agent.py --task Isaac-Humanoid-v0 --num_envs 128 --viz newton presets=physxThe Ant and Humanoid repro commands start without the previous
[omni.physx.tensors.plugin] Failed to find rigid body at .../Robot/joints/...warnings.