Repository navigation
Add more reset camera tests for articulations and pause/resume - #8482
Conversation
bcecdac to
e17ecc2
Compare
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Style consistency (2), Test quality (1). Other reviewed categories look good.
- PR description: Retitle the PR to describe test coverage rather than a fix, and remove the review-history sentence about renamed variables; the remaining scope, baseline results, limitation, and validation match the diff.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: The reset helpers specify physical configuration inconsistently, increasing drift risk; document
camera_heightin metres and share one constant for the camera far clip and silhouette threshold. - Test quality: The strict resume xfail accepts any AssertionError, so pose or step-count regressions appear expected; confine xfail to the IoU assertion or use distinct exception types for preconditions.
Minor fixes needed. Posted 3 inline findings.
Automated review; human maintainers own approval decisions.
|
e17ecc2 to
33c8297
Compare
|
run-ci |
|
@pv-nvidia looks like the CI is failing? I re-ran it, still failed? the tests look reasonable otherwise |
|
@AntoineRichard yes, the tests succeeded on my local machine, but not on CI. I also noticed they are PhysX specific, so the location is wrong. Furthermore I don't like image comparison, I will replace the tests with fabric worldmatrix reading, although this then misses the stale image test, so I need some more time to dig into this. Converted back to draft |
|
run-ci |
|
Hi @pv-nvidia, can you add to the PR description how much this adds to CI time? |
|
@StafaH CI time for this PR, from the per-file wall times in the CI run on
|
|
Thanks for the measurement. You are right: almost all of the cost came from the second Kit start-up of the new file. The PR now adds the Fabric checks to the existing reset test in
Local timing of the file, warm caches: |
Add a Cartpole first-reset test whose joint offsets move links through forward kinematics, which follows a different Fabric path than rigid root pose writes. The test fails with the PhysxManager.play() code from before isaac-sim#8433 (IoU 0.400) and passes with the fix. Add a strict xfail test for a reset directly after pause and resume. omni.physx.fabric force_update() ignores GPU tensor pose writes after the resume re-attach until the next simulate() call. Only a dedicated stale frame error counts as the expected failure, so pose and step-count regressions still fail the test. The test flags when a PhysX update fixes this limitation. Restore the check that the cube holds the reset pose while the reference frame stabilizes. Share the scene setup, step, pose, and silhouette helpers between the reset tests, use the core Cartpole test scene, and scope the tests to the default CUDA device through test_devices().
An empty reference silhouette now fails the resume test instead of counting as the expected stale frame. The camera height argument of the reset scene helper now states its unit.
The reset camera tests configure PhysX, Fabric, and the Kit renderer, so they belong with the PhysX tests. Move them unchanged to source/isaaclab_physx/test/envs/test_env_reset_camera_observation.py. The textured first-frame test stays in the core sensor tests.
The reset tests compared depth silhouettes of camera images. Issues isaac-sim#6394 and isaac-sim#8428 were both stale Fabric transforms after a reset, and RTX renders from omni:fabric:worldMatrix. Compare that attribute with the expected poses instead. The checks are exact and need no reference frames, IoU thresholds, or stabilization steps. The articulation test captures the Fabric link transforms right after the reset and compares them with the PhysX link poses after one physics step. It also checks that the reset already ran forward kinematics. The scene keeps a camera, because RTX cameras switch on continuous Fabric transform updates. The file is now test_env_reset_fabric_poses.py.
The resume test raised a custom exception for its expected failure. pytest stores every exception of a test call in sys.last_exc, and the Kit launcher exits with status 1 at exit when sys.last_exc is set. As the last test in its file, the xfail test made the file fail in CI although pytest reported 2 passed and 1 xfailed. Call pytest.xfail() instead. It raises a BaseException, which pytest does not store in sys.last_exc. The strict marker accepts only that exception, so other failures and an unexpected pass still fail the test. The stale pose after a resume does not depend on the Fabric re-attach. Without the re-attach, Fabric keeps the pose from before the pause. Describe the limitation as a timeline resume limitation.
The Fabric checks cannot see a stale observation from the render path, for example when the reset does not render again. No other test checks the image content that a reset returns. Restore the depth silhouette comparison of the first and the later reset in the cube test, next to its Fabric checks. With num_rerenders_on_reset = 0, the Fabric checks pass and only the image check fails (IoU 0.370). The articulation and resume tests keep their Fabric checks only.
RTX writes +inf where a ray hits nothing, so a finite depth marks a silhouette pixel. The extra depth bounds never filtered a pixel. If the background encoding changes, the check that the reference silhouettes do not overlap fails. Rename the Fabric rotation matrices to orientation_matrices, because rotations suggests Euler angles or quaternions, and name the translation row positions.
The custom clipping range served the old depth bounds of the silhouette. The scenes have no geometry near the camera or beyond the default far clip, so the default range renders the same silhouettes. The comment on pytest.xfail() now names the cause: the Kit launcher exits with status 1 when sys.last_exc is set.
Read Fabric without prefetching USD data, so a prim that is missing in Fabric cannot fall back to its authored spawn pose. Assert that the world matrix attribute exists. In the resume test, read the PhysX pose directly, because the asset data returns the written pose until the next physics step. Accept the stale Fabric pose as the expected failure only when one physics step clears it, so a permanent freeze fails. Re-raise the error when --runxfail turns pytest.xfail() into a no-op. Count zero depth as background, because RTX fills a frame that it did not render with zeros. Remove copies of observations that the observation manager already returns as snapshots, use get_current_stage(fabric=True) and map_body_ids_to_backend(), and describe how Fabric Hierarchy and FSD feed RTX.
The separate test file started a second Kit app with cameras, which cost about 28 s in CI. Add the Fabric checks to test_env_reset_restores_initial_pose_in_camera_observation, where the reset camera test lived before. The checks read the cube transform in Fabric after the first reset, after the move, and after the later reset. Remove the Cartpole test. The physx-cartpole-kit-tiled golden image fails when play() re-syncs Fabric on the first start, and both that golden image and test_articulation.py fail when update_kinematics() does nothing. Remove the strict xfail resume test. It guards no Isaac Lab code.
74b7b45 to
2b43819
Compare
|
run-ci |
|
@StafaH Updated CI timing after the rework on
|
maxkra15
left a comment
There was a problem hiding this comment.
The Fabric pose assertions extend the existing reset test cleanly. Matrix checks and current-head GPU tests pass. No remaining review findings.
Description
Extend the existing reset camera test with checks of the Fabric world transforms. Tests only, no production change.
Fixes the remaining test gap of #8428. #8433 fixed the defect.
What changed
test_env_reset_restores_initial_pose_in_camera_observationinsource/isaaclab/test/sensors/test_first_frame_textured_rendering.pynow also readsomni:fabric:worldMatrixof the cube:RTX renders from these matrices. The Fabric checks show if a failure comes from the Fabric publication or from the render path. The depth image checks stay unchanged.
Validation
Mutation checks. Each change was applied temporarily, and the file was run:
PhysxManager.play()re-syncs Fabric on the first start (code before #8433)num_rerenders_on_reset = 0CI cost
No new test file, so no additional Kit start-up. Local timing of the file with warm caches (pytest time, two runs each):
test_first_frame_textured_rendering.pydevelopThe added cost is below the run-to-run variation.
Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there🤖 Generated with Claude Code