From 4747d26cf6ef56ba62d4706024036cd3f7859fd3 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Mon, 11 May 2026 00:53:27 -0500 Subject: [PATCH] palisade and gen2 bolt --- opendbc_repo/opendbc/car/hyundai/interface.py | 4 ++-- .../opendbc/car/hyundai/tests/test_hyundai.py | 4 ++-- selfdrive/controls/lib/latcontrol_torque.py | 12 ++++++++++-- selfdrive/controls/tests/test_latcontrol.py | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/interface.py b/opendbc_repo/opendbc/car/hyundai/interface.py index b917a5184..8b94e1219 100644 --- a/opendbc_repo/opendbc/car/hyundai/interface.py +++ b/opendbc_repo/opendbc/car/hyundai/interface.py @@ -201,10 +201,10 @@ class CarInterface(CarInterfaceBase): ret.vEgoStopping = 0.8 if candidate == CAR.HYUNDAI_PALISADE_2023: - ret.startAccel = 1.2 + ret.startAccel = 1.25 ret.stopAccel = -1.1 ret.stoppingDecelRate = 0.4 - ret.vEgoStarting = 0.55 + ret.vEgoStarting = 0.45 ret.vEgoStopping = 0.5 if candidate == CAR.KIA_NIRO_PHEV_2022: diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py index 01ca3d30f..2fa9be021 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py @@ -175,9 +175,9 @@ class TestHyundaiFingerprint: toggles = get_test_toggles() CP = CarInterface.get_params(CAR.HYUNDAI_PALISADE_2023, gen_empty_fingerprint(), [], True, False, False, toggles) - assert CP.startAccel == pytest.approx(1.2) + assert CP.startAccel == pytest.approx(1.25) assert CP.stopAccel == pytest.approx(-1.1) - assert CP.vEgoStarting == pytest.approx(0.55) + assert CP.vEgoStarting == pytest.approx(0.45) assert CP.vEgoStopping == pytest.approx(0.5) assert CP.stoppingDecelRate == pytest.approx(0.4) diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index 78da9f2fb..5b2e11342 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -178,9 +178,14 @@ BOLT_2022_2023_TURN_IN_BOOST_LEFT = 0.15 BOLT_2022_2023_TURN_IN_BOOST_RIGHT = 0.09 BOLT_2022_2023_UNWIND_TAPER_LEFT = 0.38 BOLT_2022_2023_UNWIND_TAPER_RIGHT = 0.34 -BOLT_2022_2023_FRICTION_MULT = 1.13 +BOLT_2022_2023_FRICTION_MULT = 1.09 BOLT_2022_2023_FRICTION_LAT_RISE = 0.22 BOLT_2022_2023_FRICTION_JERK_RISE = 0.26 +BOLT_2022_2023_CENTER_TAPER_MAX = 0.11 +BOLT_2022_2023_CENTER_TAPER_LAT = 0.18 +BOLT_2022_2023_CENTER_TAPER_LAT_WIDTH = 0.03 +BOLT_2022_2023_CENTER_TAPER_SPEED = 25.0 +BOLT_2022_2023_CENTER_TAPER_SPEED_WIDTH = 2.5 BOLT_2022_2023_TURN_IN_THRESHOLD_REDUCTION_LEFT = 0.14 BOLT_2022_2023_TURN_IN_THRESHOLD_REDUCTION_RIGHT = 0.08 BOLT_2022_2023_UNWIND_THRESHOLD_INCREASE_LEFT = 0.26 @@ -691,6 +696,9 @@ def get_bolt_2022_2023_ff_scale(desired_lateral_accel: float, desired_lateral_je onset = _bolt_2022_2023_sigmoid((abs_lateral_accel - BOLT_2022_2023_FF_ONSET) / BOLT_2022_2023_FF_ONSET_WIDTH) cutoff = _bolt_2022_2023_sigmoid((BOLT_2022_2023_FF_CUTOFF - abs_lateral_accel) / BOLT_2022_2023_FF_CUTOFF_WIDTH) extra_scale = gain * onset * cutoff + speed_weight = _bolt_2022_2023_sigmoid((v_ego - BOLT_2022_2023_CENTER_TAPER_SPEED) / BOLT_2022_2023_CENTER_TAPER_SPEED_WIDTH) + center_weight = _bolt_2022_2023_sigmoid((BOLT_2022_2023_CENTER_TAPER_LAT - abs_lateral_accel) / BOLT_2022_2023_CENTER_TAPER_LAT_WIDTH) + center_taper = 1.0 - (BOLT_2022_2023_CENTER_TAPER_MAX * speed_weight * center_weight) low_speed_factor = _bolt_2022_2023_low_speed_factor(v_ego) transition_envelope = _bolt_2022_2023_transition_envelope(v_ego, desired_lateral_accel, desired_lateral_jerk) phase = _bolt_2022_2023_transition_phase(desired_lateral_accel, desired_lateral_jerk) @@ -701,7 +709,7 @@ def get_bolt_2022_2023_ff_scale(desired_lateral_accel: float, desired_lateral_je unwind_envelope = (0.25 + 0.75 * low_speed_factor) * (1.0 + 0.45 * transition_envelope) unwind_taper = 1.0 - (_bolt_2022_2023_side_value(desired_lateral_accel, BOLT_2022_2023_UNWIND_TAPER_LEFT, BOLT_2022_2023_UNWIND_TAPER_RIGHT) * unwind_weight * unwind_envelope) - return 1.0 + (extra_scale * turn_in_boost * max(unwind_taper, 0.0)) + return 1.0 + (extra_scale * center_taper * turn_in_boost * max(unwind_taper, 0.0)) def get_bolt_2022_2023_friction_threshold(v_ego: float, desired_lateral_accel: float = 0.0, desired_lateral_jerk: float = 0.0) -> float: diff --git a/selfdrive/controls/tests/test_latcontrol.py b/selfdrive/controls/tests/test_latcontrol.py index 7bba92ac1..352969b9f 100644 --- a/selfdrive/controls/tests/test_latcontrol.py +++ b/selfdrive/controls/tests/test_latcontrol.py @@ -161,6 +161,7 @@ class TestLatControl: assert get_bolt_2022_2023_ff_scale(-0.6, -0.7, 8.0) > get_bolt_2022_2023_ff_scale(-0.6, 0.0, 8.0) assert get_bolt_2022_2023_ff_scale(0.6, -0.7, 8.0) < get_bolt_2022_2023_ff_scale(0.6, 0.0, 8.0) assert get_bolt_2022_2023_ff_scale(0.6, -0.7, 6.0) < get_bolt_2022_2023_ff_scale(0.6, -0.7, 20.0) + assert get_bolt_2022_2023_ff_scale(0.14, 0.0, 30.0) < get_bolt_2022_2023_ff_scale(0.14, 0.0, 20.0) def test_bolt_2022_2023_friction_threshold_curve(self): base = get_friction_threshold(6.0)