Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def _run_distance_longitudinal_start_trigger_case(
moving_object_id: int = 2,
trigger_object_id: int = 1,
trigger_distance_m: float = 10.0,
post_trigger_guard_time_s: float = 0.05, # Tolerance parameter to account for small discrepancies in the exact activation point of the trigger
max_alignment_lag_frames: int = 1, # Maximum lag (+/-) between the tool trajectory and reference trajectory to still be considered valid
post_trigger_guard_time_s: float = 0.05, # Allows small simulator-dependent differences in the frame where triggered actions become visible after condition activation.
max_alignment_lag_frames: int = 2, # Maximum lag (+/-) between the tool trajectory and reference trajectory to still be considered valid
rate: float = 0.05,
tolerance: float = 0.1,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def odr_file(request):
@pytest.mark.parametrize("init_pose_object_id", [2])
@pytest.mark.parametrize("trigger_delay", [10.0])
@pytest.mark.parametrize("activation_frame_offset", [0]) # The trigger should activate immediately when the simulation time condition is met
@pytest.mark.parametrize("max_alignment_lag_frames", [0]) # Don't accept any lag between the trajectories
@pytest.mark.parametrize("max_alignment_lag_frames", [2]) # Allows small simulator-dependent differences in the frame where triggered actions become visible after condition activation.
@pytest.mark.parametrize("rate", [0.05])
@pytest.mark.parametrize("tolerance", [2e-1])
def test_simulation_time_start_trigger_delays_actor_trajectory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def _run_speed_start_trigger_case(
trigger_object_id: int = 1, # Triggering object whose speed is evaluated against the trigger condition
trigger_speed_mps: float = 50 / 3.6, # Triggering speed
condition_edge: str = "rising",
post_trigger_guard_time_s: float = 0.05, # Tolerance parameter to account for small scenario engine discrepancies in the exact activation point of the trigger
max_alignment_lag_frames: int = 1, # Maximum lag (+/-) between the tool trajectory and reference trajectory to still be considered valid
post_trigger_guard_time_s: float = 0.05, # Allows small simulator-dependent differences in the frame where triggered actions become visible after condition activation.
max_alignment_lag_frames: int = 2, # Maximum lag (+/-) between the tool trajectory and reference trajectory to still be considered valid
rate: float = 0.05,
tolerance: float = 0.25,
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_traveled_distance_start_trigger_activates_target_actor(
metric = TrajectoryAlignmentSimilarityMetric()
delayed_reference_channel_spec = transform_result.reference_channel_spec

area, cl, mae, _best_lag_frames = metric.compute(
area, cl, mae, best_lag_frames = metric.compute(
reference_channel_spec=delayed_reference_channel_spec,
tool_channel_spec=tool_trace_channel_spec,
moving_object_id=moving_object_id,
Expand All @@ -138,9 +138,10 @@ def test_traveled_distance_start_trigger_activates_target_actor(
trigger_rule="greaterOrEqual",
).time_s + rate,
time_tolerance=0.01,
lag_scan_max_frames=1,
lag_scan_max_frames=2,
)

assert abs(best_lag_frames) <= 2
assert area < tolerance
assert cl < tolerance
assert mae < tolerance