Adds test for camera pose update checking#4453
Open
pascal-roth wants to merge 4 commits intoisaac-sim:mainfrom
Open
Adds test for camera pose update checking#4453pascal-roth wants to merge 4 commits intoisaac-sim:mainfrom
pascal-roth wants to merge 4 commits intoisaac-sim:mainfrom
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR adds a test case Key aspects tested:
The test addresses the camera pose staleness issue that was fixed in commit cbf51ab (#4374), which added Fabric backend support to Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test Function
participant Sim as Simulation Context
participant Robot as Articulation (ANYmal-C)
participant Camera as Camera Sensor
participant Physics as Physics Engine
Test->>Sim: setup_sim_camera fixture
Test->>Robot: Create Articulation(ANYMAL_C_CFG)
Test->>Camera: Create Camera with offset (0.5, 0.0, 0.2)
Note over Camera: prim_path=/World/Robot/base/Camera<br/>update_latest_camera_pose=True<br/>convention="world"
Test->>Sim: sim.reset()
Test->>Robot: robot.reset()
Test->>Camera: camera.reset()
Test->>Sim: sim.step()
Test->>Robot: robot.update(dt)
Test->>Camera: camera.update(dt)
Note over Camera: Calls _update_poses()<br/>reads world pose via XformPrimView
Test->>Camera: Get initial_camera_pos
Test->>Robot: Get initial_base_pos & initial_base_quat
Test->>Test: Calculate expected_pos = base_pos + quat_apply(base_quat, offset)
Test->>Test: Assert initial position matches (rtol=0.02)
loop 20 simulation steps
Test->>Sim: sim.step()
Test->>Robot: robot.update(dt)
Physics->>Robot: Apply gravity, update physics state
Test->>Camera: camera.update(dt)
Note over Camera: update_latest_camera_pose=True<br/>triggers _update_poses()
Camera->>Camera: _view.get_world_poses()
Camera->>Camera: Update data.pos_w
Test->>Camera: Get current_camera_pos
Test->>Robot: Get current_base_pos & current_base_quat
Test->>Test: Calculate expected_pos = base_pos + quat_apply(base_quat, offset)
Test->>Test: Compute and store error
end
Test->>Test: Verify max_error < 0.02
Test->>Test: Verify mean_error < 0.015
|
2ef7fc8 to
f3061a4
Compare
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.
Description
Adds test that the camera pose is updated when
update_latest_camera_poseis set to True.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there