From 949cbd214bef00534cd30a6ed526c148d9a923c2 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Fri, 13 Jul 2018 15:52:59 -0700 Subject: [PATCH] fixed resume press when comma pedal is used --- selfdrive/controls/lib/drive_helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index 10d3eee73ddaec..d08ad37c04e3ed 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -92,11 +92,11 @@ def update_v_cruise(v_cruise_kph, buttonEvents, enabled): def initialize_v_cruise(v_ego, buttonEvents, v_cruise_last): for b in buttonEvents: - # 300kph or above probably means we never had a set speed - if b.type == "accelCruise" and v_cruise_last < 300: + # 250kph or above probably means we never had a set speed + if b.type == "accelCruise" and v_cruise_last < 250: return v_cruise_last - return int(round(max(v_ego * CV.MS_TO_KPH, V_CRUISE_ENABLE_MIN))) + return int(round(clip(v_ego * CV.MS_TO_KPH, V_CRUISE_ENABLE_MIN, V_CRUISE_MAX))) def kill_defaultd():