test_following_distance: bump error margin when initial speed is 0 (#37196)

This commit is contained in:
felsager
2026-02-12 20:59:14 -08:00
committed by GitHub
parent 2e21deeae8
commit a61badb564
@@ -42,4 +42,5 @@ class TestFollowingDistance:
simulation_steady_state = run_following_distance_simulation(v_lead, e2e=self.e2e, personality=self.personality)
correct_steady_state = desired_follow_distance(v_lead, v_lead, get_T_FOLLOW(self.personality))
err_ratio = 0.2 if self.e2e else 0.1
assert simulation_steady_state == pytest.approx(correct_steady_state, abs=err_ratio * correct_steady_state + .5)
abs_err_margin = 0.5 if v_lead > 0.0 else 1.15
assert simulation_steady_state == pytest.approx(correct_steady_state, abs=err_ratio * correct_steady_state + abs_err_margin)