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 <shane@smiskol.com>
pull/24239/head^2
Jason Young 3 years ago committed by GitHub
parent 2fa5a59e3f
commit 45f131e0e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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)))

Loading…
Cancel
Save