From d82f65a1b747c0108a5dfd17a7b49341de1ecf2c Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Thu, 28 Apr 2022 20:46:58 -0400 Subject: [PATCH] Accept resumeCruise for resuming prior speed setpoint (#24348) * accept two button types for resume * retry CI * Update selfdrive/controls/lib/drive_helpers.py Co-authored-by: Shane Smiskol old-commit-hash: 45f131e0e7d1df168295f180195a3b06aba87736 --- selfdrive/controls/lib/drive_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index ca5c1d3329..a9725a475f 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -79,7 +79,7 @@ def update_v_cruise(v_cruise_kph, buttonEvents, button_timers, enabled, metric): def initialize_v_cruise(v_ego, buttonEvents, v_cruise_last): for b in buttonEvents: # 250kph or above probably means we never had a set speed - if b.type == car.CarState.ButtonEvent.Type.accelCruise and v_cruise_last < 250: + if b.type in (car.CarState.ButtonEvent.Type.accelCruise, car.CarState.ButtonEvent.Type.resumeCruise) and v_cruise_last < 250: return v_cruise_last return int(round(clip(v_ego * CV.MS_TO_KPH, V_CRUISE_ENABLE_MIN, V_CRUISE_MAX)))