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