Skip to content

Commit ef73a02

Browse files
committed
update test
Signed-off-by: zhx06 <zihaox@nvidia.com>
1 parent db06239 commit ef73a02

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

isaaclab_arena/tests/test_validate_placement.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,19 @@ def test_candidate_bbox_aligns_with_candidate_yaw():
135135

136136

137137
def test_rotate_candidate_bboxes_encloses_marker_plus_sampled_yaw():
138-
"""_rotate_candidate_bboxes folds the marker yaw into the box, not just the sampled yaw."""
138+
"""_rotate_candidate_bboxes applies the total yaw (marker + sampled) passed by the caller."""
139139
box = _make_long_box("box")
140140
marker_yaw, sampled_yaw = math.pi / 6, math.pi / 3
141+
total_yaw = marker_yaw + sampled_yaw
141142
box.add_relation(RotateAroundSolution(yaw_rad=marker_yaw))
142143

143-
rotated = ObjectPlacer._rotate_candidate_bboxes([box], {box: box.get_bounding_box()}, [{box: sampled_yaw}])
144+
# In production, _generate_initial_orientations computes total_yaw before calling this method.
145+
rotated = ObjectPlacer._rotate_candidate_bboxes([box], {box: box.get_bounding_box()}, [{box: total_yaw}])
144146

145-
expected = box.get_bounding_box().rotated_around_z(marker_yaw + sampled_yaw)
147+
expected = box.get_bounding_box().rotated_around_z(total_yaw)
146148
torch.testing.assert_close(rotated[box].min_point, expected.min_point, atol=1e-6, rtol=0)
147149
torch.testing.assert_close(rotated[box].max_point, expected.max_point, atol=1e-6, rtol=0)
148-
# Dropping the marker (sampled yaw only) would enclose an undersized, misaligned footprint.
150+
# Passing only sampled_yaw (without marker) would enclose an undersized, misaligned footprint.
149151
sampled_only = box.get_bounding_box().rotated_around_z(sampled_yaw)
150152
assert not torch.allclose(rotated[box].max_point, sampled_only.max_point, atol=1e-6)
151153

0 commit comments

Comments
 (0)