Honda: keep braking after PCM disables cruise (#21510)

* Honda: keep braking after PCM disables cruise

* update refs
old-commit-hash: 6d9dc9945a
vw-mqb-aeb
Adeeb Shihadeh 4 years ago committed by GitHub
parent e24ff01513
commit 7c9ce25b05
  1. 23
      selfdrive/car/honda/interface.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -509,7 +509,7 @@ class CarInterface(CarInterfaceBase):
ret.buttonEvents = buttonEvents
# events
events = self.create_common_events(ret, pcm_enable=self.CP.pcmCruise)
events = self.create_common_events(ret, pcm_enable=False)
if self.CS.brake_error:
events.add(EventName.brakeUnavailable)
if self.CS.brake_hold and self.CS.CP.openpilotLongitudinalControl:
@ -520,15 +520,18 @@ class CarInterface(CarInterfaceBase):
if self.CP.pcmCruise and ret.vEgo < self.CP.minEnableSpeed:
events.add(EventName.belowEngageSpeed)
# it can happen that car cruise disables while comma system is enabled: need to
# keep braking if needed or if the speed is very low
if self.CP.pcmCruise and not ret.cruiseState.enabled \
and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl):
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
if ret.vEgo < self.CP.minEnableSpeed + 2.:
events.add(EventName.speedTooLow)
else:
events.add(EventName.cruiseDisabled)
if self.CP.pcmCruise:
# we engage when pcm is active (rising edge)
if ret.cruiseState.enabled and not self.CS.out.cruiseState.enabled:
events.add(EventName.pcmEnable)
elif not ret.cruiseState.enabled and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl):
# it can happen that car cruise disables while comma system is enabled: need to
# keep braking if needed or if the speed is very low
if ret.vEgo < self.CP.minEnableSpeed + 2.:
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
events.add(EventName.speedTooLow)
else:
events.add(EventName.cruiseDisabled)
if self.CS.CP.minEnableSpeed > 0 and ret.vEgo < 0.001:
events.add(EventName.manualRestart)

@ -1 +1 @@
f60d169bb4fc56110ffc420395a1fb7d28b45094
c59e46e21147ee1dc44b7fe2b5d1e4a16842c6c5
Loading…
Cancel
Save