Skip to content

Fix reset cameras moving to their env-local pose - #8682

Closed
pv-nvidia wants to merge 3 commits into
isaac-sim:mainfrom
pv-nvidia:pv/fix-fabric-hierarchy-seed
Closed

pv-nvidia wants to merge 3 commits into
isaac-sim:mainfrom
pv-nvidia:pv/fix-fabric-hierarchy-seed

Conversation

@pv-nvidia

@pv-nvidia pv-nvidia commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

With GPU PhysX, the camera of every environment that resets after the first reset moves to its env-local pose. The camera then renders from near the world origin, which usually shows an empty ground plane. Training with isaaclab train (no RTX extensions) shows this for every camera task, for example Isaac-Lift-KukaAllegro-Camera.

Root cause

FabricXformSelection seeds the Fabric matrices of the frame views and their parents. It called usdrt.Rt.Xformable.SetLocalXformFromUsd() and SetWorldXformFromUsd(). These helpers do not write the Fabric Hierarchy matrices. They write the legacy OmniHydra attributes _localMatrix, _worldPosition, _worldOrientation, and _worldScale (see usdrt.scenegraph/Xformable.cpp). Thus, omni:fabric:localMatrix and omni:fabric:worldMatrix kept their identity defaults.

FabricFrameView then wrote the child matrices and the parent world matrices on the GPU, but not the parent local matrices. Fabric Hierarchy composes worldMatrix = localMatrix * world(ancestor). So the next hierarchy update, which sim.forward() runs through omni.physx.fabric, set the world matrix of each env_N to identity. Camera.reset() reads the pose from Fabric after that update, so each reset camera got its env-local pose.

The bug came in with #5677. #8433 made it visible: before #8433, the Fabric stage re-attach at play rebuilt the parent matrices.

Fix

FabricXformSelection now writes omni:fabric:worldMatrix and omni:fabric:localMatrix with values from USD:

  • The world matrix is the USD world transform.
  • The local matrix is relative to the nearest ancestor that has omni:fabric:localMatrix, because Fabric Hierarchy treats ancestors without Fabric matrices as identity. This is not always the USD local transform.
  • Parents are seeded before children, so that each child finds its parent's matrices.
  • The legacy OmniHydra attributes are no longer written.

The Newton site mirror (seed_from_usd=False) uses the same code for the attributes that it creates.

Tests

The new test test_partial_env_reset_keeps_camera_world_pose builds 4 cloned environments with a Warp camera. It resets all environments, then resets environments 1 and 2, and checks the camera world positions. The test fails without the fix (the reset cameras are off by the distance of their env origin) and passes with it.

A bare test stage cannot show this bug: there, sim.reset() writes the parent matrices from USD. The test therefore uses cloned environments and the env reset path, where the bug occurs in training.

Validation

All runs on an RTX PRO 5000 Blackwell with Isaac Sim 6.1.

Check Without fix With fix
isaaclab train Isaac-Lift-KukaAllegro-Camera, 64 envs, 3 iterations: cameras off their env pose 20/64 0/64
Same, 8192 envs, 20 iterations 8191/8192 0/8192
test_views_xform_prim_fabric.py new test fails 53 passed, 3 skipped
test_views_xform_prim_newton.py 45 passed
test_first_frame_textured_rendering.py (#8428) 2 passed

Golden rendering tests are still running. I will post the result in a comment.

Limitations and follow-ups

  • FabricFrameView._sync_fabric_from_usd_initial now writes the same values a second time on the GPU. This change keeps it. A follow-up can remove it.
  • I did not check the omniperf benchmark (RTX extensions loaded) with this change. The legacy _world* attributes take precedence in OmniHydra, so RTX rendering can behave differently.

Type of change

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 16, 2026
@pv-nvidia pv-nvidia changed the title Fix fabric hierarchy seed Fix reset cameras moving to their env-local pose Oct 16, 2026
Walk USD ancestors with prim parents instead of a string rule, convert
matrices in one module-level helper, and import pxr at module level. Add a
frame-view test that reads a subset of cameras before sim.forward(), which
is what a partial environment reset does, and shrink the changelog entry.
Reject a Fabric prim without a USD counterpart instead of seeding identity.
Compose the local matrix with XformCache.ComputeRelativeTransform, which
stays exact for a singular anchor, and only when the local matrix is seeded.
Reuse get_first_matching_ancestor_prim and the usdrt matrix constructor.
The view-level test now rotates and scales the environment prims, so a
wrong matrix order or a missing parent local fails it, and closes its view
through a finalizer.
@pv-nvidia

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 16, 2026
pv-nvidia added a commit that referenced this pull request Oct 20, 2026
# Description

With PhysX and a camera that Kit does not render (for example the Newton
Warp renderer), every camera whose environment resets moves to its
env-local pose. The camera then renders an empty floor instead of its
environment. Training runs are affected after the first episode.

Fabric frame views seed their transforms with usdrt's `*XformFromUsd`
helpers, which write legacy transform attributes. Only the host Fabric
Hierarchy update turns these into the `omni:fabric` matrices, and Kit
runs that update every frame only when the Fabric Scene Delegate is on.
The headless experience has it off. PhysX's GPU hierarchy update then
rebuilt the environment prims from identity local matrices.

This PR runs the host Fabric Hierarchy update once after each Fabric
xform selection seeds its transforms.

It replaces #8682.

## Type of change

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

## Release backport

- [ ] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

`release/3.0.0` needs its own PR, because its `PhysxManager.play()`
differs.

## Validation

`Isaac-Lift-KukaAllegro-Camera`, PhysX, Newton Warp renderer, 8192
environments, RTX A6000:

- On `c8a06a87c`, after all environments reset, all 8192 cameras are
correct in training and in the `summary` benchmark mode.
- On the current `develop`, no camera falls back to its env-local pose
anymore. A separate regression on `develop` assigns cameras to the wrong
environments, with or without this PR. It also happens with the Fabric
Scene Delegate on.
- The new test `test_hierarchy_update_keeps_seeded_world_poses` fails
without the fix and passes with it.
- The Fabric frame view tests, the RTX rigid object rendering tests, the
#8428 first-frame tests, the simulation context tests, and the Kit
pause/resume tests pass.
- Startup cost: the runtime benchmark
(`isaaclab.benchmark.entrypoints.runtime --benchmark_formatter json
--num_envs 8192 --num_steps 300 --warmup_steps 50 --seed 42
presets=isaacsim_physx`, two runs each) reported a "simulation start"
time of 110.9 s and 112.1 s on `c8a06a87c`. With the host update
(`a5211fa0d`), it reported 113.8 s and 113.6 s. FPS and peak memory
stayed within run-to-run noise.

## 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
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Co-authored-by: pv-nvidia <[email protected]>
@pv-nvidia pv-nvidia closed this Oct 21, 2026
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.

1 participant