Skip to content

Commit

Permalink
Merge pull request commaai#290 from commaai/pedal-resum-speed-fix
Browse files Browse the repository at this point in the history
fixed resume press when comma pedal is used
  • Loading branch information
geohot authored Jul 13, 2018
2 parents 0d9447c + 949cbd2 commit 734002e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 734002e

Please sign in to comment.