Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Re-enable cruise cancel and gas/brake cancel.
Browse files Browse the repository at this point in the history
Note: Gas cancel will lead to a mismatch, might need to think about a better solution here.
  • Loading branch information
Felger committed Aug 16, 2020
1 parent 380b05c commit b524a2d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def update(self, c, can_strings):
be.type = ButtonType.accelCruise # Suppress resume button if we're resuming from stop so we don't adjust speed.
elif but == CruiseButtons.DECEL_SET:
be.type = ButtonType.decelCruise
# elif but == CruiseButtons.CANCEL:
# if not ret.enableGasInterceptor: #need to use cancel to disable cc with Pedal
# be.type = ButtonType.cancel
elif but == CruiseButtons.CANCEL:
if not ret.enableGasInterceptor: #need to use cancel to disable cc with Pedal
be.type = ButtonType.cancel
elif but == CruiseButtons.MAIN:
be.type = ButtonType.altButton3
buttonEvents.append(be)
Expand All @@ -201,9 +201,9 @@ def update(self, c, can_strings):
if self.CS.park_brake:
events.append(create_event('parkBrake', [ET.NO_ENTRY, ET.USER_DISABLE]))
# disable on pedals rising edge or when brake is pressed and speed isn't zero
# if (ret.gasPressed and not self.gas_pressed_prev) or \
# (ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001)):
# events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE]))
if (ret.gasPressed and not self.gas_pressed_prev and not ret.enableGasInterceptor) or \
(ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001)):
events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE]))
if ret.cruiseState.standstill:
events.append(create_event('resumeRequired', [ET.WARNING]))
if not self.CS.car_fingerprint in NO_ASCM_CARS:
Expand Down

0 comments on commit b524a2d

Please sign in to comment.