diff --git a/opendbc_repo/opendbc/car/hyundai/carcontroller.py b/opendbc_repo/opendbc/car/hyundai/carcontroller.py index 652d5e5b6..2eceda100 100644 --- a/opendbc_repo/opendbc/car/hyundai/carcontroller.py +++ b/opendbc_repo/opendbc/car/hyundai/carcontroller.py @@ -46,7 +46,7 @@ IONIQ_6_DYNAMIC_LOWER_JERK_V = [3.3, 1.5, 1.0, 0.8, 0.7, 0.65, 0.55, 0.5] IONIQ_6_LAUNCH_HOLD_SPEED_BP = [0.0, 0.6, 1.25, 2.5] IONIQ_6_LAUNCH_HOLD_SPEED_V = [0.75, 0.6, 0.4, 0.0] IONIQ_6_STOP_BRAKE_CAP_SPEED_BP = [0.0, 0.08, 0.25, 0.6, 1.2, 2.0, 3.0] -IONIQ_6_STOP_BRAKE_CAP_ACCEL_V = [-0.09, -0.095, -0.10, -0.18, -0.40, -0.80, -1.30] +IONIQ_6_STOP_BRAKE_CAP_ACCEL_V = [-0.09, -0.10, -0.11, -0.22, -0.50, -0.95, -1.40] IONIQ_6_STOP_HOLD_JERK_BP = [0.0, 0.15, 0.6, 1.2, 2.0, 3.0] IONIQ_6_STOP_HOLD_JERK_V = [0.35, 0.40, 0.48, 0.65, 0.85, 1.10] IONIQ_6_STOP_RELEASE_JERK_BP = [0.0, 0.15, 0.5] diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py index ec6b60c00..77f2cd448 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py @@ -651,7 +651,7 @@ class TestHyundaiFingerprint: state = update_ioniq_6_longitudinal_tuning(state, accel_cmd=-2.82, v_ego=2.5, a_ego=-2.4, long_control_state=LongCtrlState.stopping, long_active=True) assert state.stopping - assert state.desired_accel == pytest.approx(-1.05) + assert state.desired_accel == pytest.approx(-1.175) for _ in range(10): state = update_ioniq_6_longitudinal_tuning(state, accel_cmd=-2.82, v_ego=2.5, a_ego=-2.4, diff --git a/selfdrive/controls/lib/lead_behavior.py b/selfdrive/controls/lib/lead_behavior.py index 9a2d2ffd6..e167805e0 100644 --- a/selfdrive/controls/lib/lead_behavior.py +++ b/selfdrive/controls/lib/lead_behavior.py @@ -61,12 +61,12 @@ def should_disable_far_lead_throttle(v_ego: float, lead_distance: float, desired return False # Don't coast if we're already materially above the requested headway. - if actual_hw > max(desired_hw + 0.45, 1.85): + if actual_hw > max(desired_hw + 0.15, 1.75): return False coast_window_open = lead_distance > desired_gap + max(4.0, 0.15 * v_ego) - coast_window_far = lead_distance < desired_gap + max(15.0, 0.75 * v_ego) - gentle_closing = closing_speed < max(1.5, 0.08 * v_ego) + coast_window_far = lead_distance < desired_gap + max(12.0, 0.60 * v_ego) + gentle_closing = 0.35 < closing_speed < max(1.35, 0.05 * v_ego) ttc = lead_distance / max(closing_speed, 1e-3) if closing_speed > 0.1 else 1e6 - return coast_window_open and coast_window_far and gentle_closing and ttc > 6.0 and lead_distance > desired_gap + 6.0 + return coast_window_open and coast_window_far and gentle_closing and ttc > 7.5 and lead_distance > desired_gap + 7.0 diff --git a/selfdrive/controls/tests/test_lead_behavior.py b/selfdrive/controls/tests/test_lead_behavior.py index 30f143029..b939391d1 100644 --- a/selfdrive/controls/tests/test_lead_behavior.py +++ b/selfdrive/controls/tests/test_lead_behavior.py @@ -45,6 +45,16 @@ def test_disable_far_lead_throttle_rejects_fast_closing(): assert not should_disable +def test_disable_far_lead_throttle_rejects_route_like_highway_stab_case(): + should_disable = should_disable_far_lead_throttle(34.69, 68.5, 63.0, 2.31, False) + assert not should_disable + + +def test_disable_far_lead_throttle_rejects_large_gap_near_pace_matched_case(): + should_disable = should_disable_far_lead_throttle(32.43, 72.4, 56.0, 1.30, False) + assert not should_disable + + def test_should_track_lead_keeps_radar_leads_on_model_horizon(): assert should_track_lead(True, 95.0, 100.0, 6.0, 30.0, v_lead=25.0, radar=True)