Mazda: alert when LKAS is disabled (#23273)

* Mazda: alert when LKAS is disabled

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Update selfdrive/controls/lib/events.py

* Update selfdrive/car/mazda/interface.py

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/24010/head
Jafar Al-Gharaibeh 4 years ago committed by GitHub
parent cd7db7f48e
commit f25121b736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cereal
  2. 6
      selfdrive/car/mazda/carstate.py
  3. 4
      selfdrive/car/mazda/interface.py
  4. 5
      selfdrive/controls/lib/events.py

@ -1 +1 @@
Subproject commit f1c5c8ef7cab05b66892d67b6992f5ac1238ad4f
Subproject commit e83ec3be7d83b8d4ce227e7c2027dd1ca5f930b4

@ -16,6 +16,7 @@ class CarState(CarStateBase):
self.acc_active_last = False
self.low_speed_alert = False
self.lkas_allowed_speed = False
self.lkas_disabled = False
def update(self, cp, cp_cam):
@ -91,9 +92,12 @@ class CarState(CarStateBase):
self.acc_active_last = ret.cruiseState.enabled
self.crz_btns_counter = cp.vl["CRZ_BTNS"]["CTR"]
# camera signals
self.lkas_disabled = cp_cam.vl["CAM_LANEINFO"]["LANE_LINES"] == 0
self.cam_lkas = cp_cam.vl["CAM_LKAS"]
self.cam_laneinfo = cp_cam.vl["CAM_LANEINFO"]
self.crz_btns_counter = cp.vl["CRZ_BTNS"]["CTR"]
ret.steerError = cp_cam.vl["CAM_LKAS"]["ERR_BIT_1"] == 1
return ret

@ -86,7 +86,9 @@ class CarInterface(CarInterfaceBase):
# events
events = self.create_common_events(ret)
if self.CS.low_speed_alert:
if self.CS.lkas_disabled:
events.add(EventName.lkasDisabled)
elif self.CS.low_speed_alert:
events.add(EventName.belowSteerSpeed)
ret.events = events.to_msg()

@ -832,4 +832,9 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"),
},
EventName.lkasDisabled: {
ET.PERMANENT: NormalPermanentAlert("LKAS Disabled: Enable LKAS to engage"),
ET.NO_ENTRY: NoEntryAlert("LKAS Disabled"),
},
}

Loading…
Cancel
Save