-
Notifications
You must be signed in to change notification settings - Fork 3k
Adds test for camera pose update checking #4453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 3 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
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