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. 11
      selfdrive/car/honda/interface.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -509,7 +509,7 @@ class CarInterface(CarInterfaceBase):
ret.buttonEvents = buttonEvents ret.buttonEvents = buttonEvents
# events # 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: if self.CS.brake_error:
events.add(EventName.brakeUnavailable) events.add(EventName.brakeUnavailable)
if self.CS.brake_hold and self.CS.CP.openpilotLongitudinalControl: if self.CS.brake_hold and self.CS.CP.openpilotLongitudinalControl:
@ -520,12 +520,15 @@ class CarInterface(CarInterfaceBase):
if self.CP.pcmCruise and ret.vEgo < self.CP.minEnableSpeed: if self.CP.pcmCruise and ret.vEgo < self.CP.minEnableSpeed:
events.add(EventName.belowEngageSpeed) events.add(EventName.belowEngageSpeed)
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 # 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 # 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.: if ret.vEgo < self.CP.minEnableSpeed + 2.:
# non loud alert if cruise disables below 25mph as expected (+ a little margin)
events.add(EventName.speedTooLow) events.add(EventName.speedTooLow)
else: else:
events.add(EventName.cruiseDisabled) events.add(EventName.cruiseDisabled)

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