build out lockout

pull/35700/head
Shane Smiskol 1 month ago
parent efa035d181
commit b10802d9a2
  1. 1
      cereal/log.capnp
  2. 6
      selfdrive/selfdrived/events.py
  3. 8
      selfdrive/selfdrived/selfdrived.py

@ -128,6 +128,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
personalityChanged @91;
aeb @92;
userFlag @95;
lateralIsoViolation @96;
soundsUnavailableDEPRECATED @47;
}

@ -758,6 +758,12 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Distraction Level Too High"),
},
EventName.lateralIsoViolation: {
# TODO: call Iso something else if we don't explain it in the offroad alert?
ET.SOFT_DISABLE: soft_disable_alert("Lateral ISO Violation"),
ET.NO_ENTRY: NoEntryAlert("Lateral ISO Violation"), # TODO: call Iso something else if we don't explain it in the offroad alert?
},
EventName.overheat: {
ET.PERMANENT: overheat_alert,
ET.SOFT_DISABLE: soft_disable_alert("System Overheated"),

@ -107,6 +107,7 @@ class SelfdriveD:
self.active = False
self.mismatch_counter = 0
self.cruise_mismatch_counter = 0
self.lateral_iso_violation = False
self.last_steering_pressed_frame = 0
self.distance_traveled = 0
self.last_functional_fan_frame = 0
@ -232,9 +233,12 @@ class SelfdriveD:
if self.sm['driverAssistance'].leftLaneDeparture or self.sm['driverAssistance'].rightLaneDeparture:
self.events.add(EventName.ldw)
if check_lateral_iso_violation(self.sm):
if not self.lateral_iso_violation and check_lateral_iso_violation(self.sm):
set_offroad_alert("Offroad_LateralIsoViolation", True)
# TODO: lockout for rest of drive like DM attention warning
self.lateral_iso_violation = True
if self.lateral_iso_violation:
self.events.add(EventName.lateralIsoViolation)
# Handle lane change
if self.sm['modelV2'].meta.laneChangeState == LaneChangeState.preLaneChange:

Loading…
Cancel
Save