mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-25 12:02:05 +08:00
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>
old-commit-hash: 45f131e0e7
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user