Repository navigation
Add cross-backend repro for dropped camera pose writes - #4
Draft
alexmillane wants to merge 5 commits into
Draft
alexmillane wants to merge 5 commits into
alexmillane wants to merge 5 commits into
Conversation
Camera.set_world_poses writes through the sensor's FrameView. Under PhysX that view is Fabric-backed, so the RTX renderer -- which reads the USD/Fabric camera prim -- follows the write. Under Newton the view is a NewtonSiteFrameView, which updates only in-memory Warp state; nothing mirrors the pose onto the camera prim, so the rendered image stays at the old pose. Add a backend-parametrized test that moves a downward-looking camera from 2 m to 8 m over a ground plane and checks both observable consequences of the write: camera.data.pos_w (passes on both backends, isolating the failure to the renderer) and the rendered depth, which under Newton is unchanged at a 1.00x far-to-close ratio instead of the expected ~4x. Signed-off-by: Alex Millane <[email protected]>
alexmillane
commented
Sep 8, 2026
Comment on lines
+8
to
+21
| :meth:`Camera.set_world_poses` writes through the sensor's :class:`FrameView`. Under PhysX that view is | ||
| Fabric-backed (:class:`FabricFrameView`), so the RTX renderer -- which reads the USD/Fabric camera prim -- | ||
| follows the write. Under Newton the view is a :class:`NewtonSiteFrameView`, which updates only in-memory | ||
| Warp state; nothing mirrors the pose back to the camera prim, so the rendered image keeps the old pose | ||
| even though ``camera.data.pos_w`` reports the new one. | ||
|
|
||
| Both tests move a downward-looking camera straight up over a ground plane, which multiplies the distance | ||
| to every visible surface, and check the two observable consequences of the write: | ||
|
|
||
| - ``_moves_reported_pose_*`` reads ``camera.data.pos_w`` (deterministic, no renderer involved). | ||
| - ``_moves_render_*`` compares the rendered depth before and after the move. | ||
|
|
||
| :func:`test_camera_pose_update_reflected_in_render` in ``test_camera.py`` covers the render half of this on | ||
| the default (PhysX) backend only; these tests parametrize the backend so the Newton regression is visible. |
Owner
Author
There was a problem hiding this comment.
Removed — the cross-reference to test_camera.py is gone from the module docstring.
| # launch omniverse app | ||
| simulation_app = AppLauncher(headless=True, enable_cameras=True).app | ||
|
|
||
| """Rest everything follows.""" |
Owner
Author
There was a problem hiding this comment.
Removed the ""Rest everything follows.""" marker.
Comment on lines
+52
to
+65
| DEVICE = "cuda:0" | ||
| HEIGHT = 128 | ||
| WIDTH = 256 | ||
| # Camera heights [m] above the ground plane, looking straight down. Moving between them multiplies the | ||
| # distance to every visible surface, so both the reported pose and the rendered depth must change. | ||
| CAMERA_HEIGHT_CLOSE_M = 2.0 | ||
| CAMERA_HEIGHT_FAR_M = 8.0 | ||
| # Reported world-pose shift [m] below which the write is considered to have been dropped. | ||
| POSE_SHIFT_THRESHOLD_M = 0.5 * (CAMERA_HEIGHT_FAR_M - CAMERA_HEIGHT_CLOSE_M) | ||
| # Minimum ratio of far-to-close mean depth. The true ratio is ~4x; 1.5 leaves room for the ground plane | ||
| # filling different fractions of the frame while still failing hard if the render does not move at all. | ||
| DEPTH_RATIO_THRESHOLD = 1.5 | ||
| # Physics steps taken after each pose write so the renderer produces a frame at the new pose. | ||
| STEPS_PER_POSE = 2 |
Owner
Author
There was a problem hiding this comment.
Move all of this into the test.
Owner
Author
There was a problem hiding this comment.
Moved. The camera heights and thresholds now live in each test; the device, resolution, step count and clipping range moved into _capture_at_heights, which takes the heights as an argument and returns the mean visible depth so the tests no longer need the clipping range. Only BACKEND_CFGS/BACKEND_IDS stay at module scope, since parametrize needs them at decoration time.
- Drop the cross-reference to test_camera.py and the "Rest everything follows" marker. - Move the tuning constants (camera heights, thresholds, resolution, device, step count) out of module scope: heights and thresholds now live in each test, the rest inside the capture helper, which takes the heights as an argument and returns the mean visible depth so the tests no longer need the clipping range. Signed-off-by: Alex Millane <[email protected]>
Setting ISAACLAB_TEST_SAVE_IMAGES=1 writes one PNG per camera height under <test dir>/output/<test name>/. Grey level maps depth against a fixed scale set by the highest commanded pose rather than each frame's own range, so a camera that never moved renders identically across heights instead of being re-normalized back into looking correct. Signed-off-by: Alex Millane <[email protected]>
The RGB view is the more legible of the two: pulling the camera back brings more of the ground plane's grid into frame, so the stale Newton render is visible as an unchanged number of grid cells rather than as a brightness difference. Signed-off-by: Alex Millane <[email protected]>
Add three coloured marker cubes: one directly under the camera that shrinks as it rises, and two that sit outside the frame at 2 m and only come into view at 8 m. The PhysX frames go from one large cube to three small ones; the Newton frames stay on the single large cube, which reads at a glance. The markers are plain USD gprims at /World rather than scene entities because geometry placed under /World/envs/env_* by InteractiveScene does not reach the RTX renderer in a bare build_simulation_context -- the same prim spawned at /World renders. The scene cube is therefore invisible and only exists to give Newton a body to build its model from. Signed-off-by: Alex Millane <[email protected]>
7 tasks done
This branch has not been deployed
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.
Summary
Repro-only PR: a failing test that pins down camera pose writes not reaching the renderer under the Newton backend.
Details
Camera.set_world_poseswrites through the sensor'sFrameView. Under PhysX that view is Fabric-backed (FabricFrameView), so the RTX renderer — which reads the USD/Fabric camera prim — follows the write. Under Newton the view is aNewtonSiteFrameView, which updates only in-memory Warp state; nothing mirrors the pose onto the camera prim, so the rendered image stays at the old pose.What the test does
source/isaaclab/test/sensors/test_camera_pose_write_across_backends.pymoves a downward-looking camera from 2 m to 8 m over a ground plane via the publicset_world_poses, parametrized overPhysxCfg()andNewtonCfg(solver_cfg=MJWarpSolverCfg()), and checks the two observable consequences of the write:test_camera_pose_write_moves_reported_pose—camera.data.pos_wfollows the write. Passes on both backends.test_camera_pose_write_moves_render— the rendereddistance_to_cameramust grow when the camera rises 4x.Results
Run