This commit is contained in:
whoisdomi
2026-11-07 22:44:23 -06:00
parent 9bcc7bdd2d
commit 401d177f5d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ def get_action_from_model(model_output: dict[str, np.ndarray], prev_action: log.
lat_action_t)
else:
desired_accel = model_output['action'][0,1]
desired_curvature = model_output['action'][0,0] / (max(2.5, v_ego))**2
desired_curvature = model_output['action'][0,0] / (max(1.0, v_ego))**2
stop = should_stop(v_ego, desired_accel)
desired_accel = smooth_value(desired_accel, prev_action.desiredAcceleration, LONG_SMOOTH_SECONDS)
if v_ego > MIN_LAT_CONTROL_SPEED:
@@ -25,7 +25,7 @@ def action_function():
def test_action_curvature_low_speed_threshold(speed):
previous = log.ModelDataV2.Action(desiredCurvature=0.01, desiredAcceleration=0.1)
action = action_function()({"action": np.array([[0.25, 0.5]])}, previous, 0.2, 0.2, speed)
expected = smooth_value(0.25 / max(2.5, speed) ** 2, 0.01, LAT_SMOOTH_SECONDS) if speed > 0.3 else 0.01
expected = smooth_value(0.25 / max(1.0, speed) ** 2, 0.01, LAT_SMOOTH_SECONDS) if speed > 0.3 else 0.01
assert action.desiredCurvature == pytest.approx(expected)
assert action.desiredAcceleration == pytest.approx(smooth_value(0.5, 0.1, 0.3))
assert not action.shouldStop