From cda0faa3d6a8cd2862a085dc06e151f6da4231aa Mon Sep 17 00:00:00 2001 From: ajouatom Date: Wed, 19 Feb 2025 15:33:29 +0900 Subject: [PATCH] fix.. decelCruise button at cruise activated. --- selfdrive/car/cruise.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/cruise.py b/selfdrive/car/cruise.py index e28a38b..181a510 100644 --- a/selfdrive/car/cruise.py +++ b/selfdrive/car/cruise.py @@ -442,6 +442,8 @@ class VCruiseCarrot: v_cruise_kph, button_type, long_pressed = self._carrot_command(v_cruise_kph, button_type, long_pressed) + cruise_activated = not self.enabled_last and CC.enabled + if button_type in [ButtonType.accelCruise, ButtonType.decelCruise]: if self.autoCruiseControl_cancel_timer > 0: self._add_log(f"AutoCruiseControl cancel timer RESET {button_type}") @@ -469,6 +471,8 @@ class VCruiseCarrot: self._pause_auto_speed_up = True if self._soft_hold_active > 0: self._cruise_control(-1, -1, "Cruise off,softhold mode (decelCruise)") + elif cruise_activated: + v_cruise_kph = self.v_ego_kph_set elif self._cruise_button_mode in [0, 1]: v_cruise_kph = button_kph elif self.v_ego_kph_set > self._cruise_speed_min and v_cruise_kph > self.v_ego_kph_set: @@ -501,6 +505,8 @@ class VCruiseCarrot: v_cruise_kph = button_kph self._v_cruise_kph_at_brake = 0 elif button_type == ButtonType.decelCruise: + if cruise_activated: + v_cruise_kph = self.v_ego_kph_set self._pause_auto_speed_up = True v_cruise_kph = button_kph self._v_cruise_kph_at_brake = 0