diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 9bb258e742..f6c2e9d149 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -570,6 +570,9 @@ def controlsd_thread(sm=None, pm=None, can_sock=None): events.append(create_event('communityFeatureDisallowed', [ET.PERMANENT])) if read_only and not passive: events.append(create_event('carUnrecognized', [ET.PERMANENT])) + if log.HealthData.FaultType.relayMalfunction in sm['health'].faults: + events.append(create_event('relayMalfunction', [ET.NO_ENTRY, ET.PERMANENT, ET.IMMEDIATE_DISABLE])) + # Only allow engagement with brake pressed when stopped behind another stopped car if CS.brakePressed and sm['plan'].vTargetFuture >= STARTING_TARGET_SPEED and not CP.radarOffCan and CS.vEgo < 0.3: diff --git a/selfdrive/controls/lib/alerts.py b/selfdrive/controls/lib/alerts.py index 63896638e2..80eaa7514f 100644 --- a/selfdrive/controls/lib/alerts.py +++ b/selfdrive/controls/lib/alerts.py @@ -503,6 +503,13 @@ ALERTS = [ AlertStatus.critical, AlertSize.full, Priority.HIGHEST, VisualAlert.steerRequired, AudibleAlert.chimeWarningRepeat, 2.2, 3., 4.), + Alert( + "relayMalfunction", + "TAKE CONTROL IMMEDIATELY", + "Harness Malfunction", + AlertStatus.critical, AlertSize.full, + Priority.HIGHEST, VisualAlert.steerRequired, AudibleAlert.chimeWarningRepeat, 2.2, 3., 4.), + # not loud cancellations (user is in control) Alert( @@ -702,6 +709,13 @@ ALERTS = [ AlertStatus.normal, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.chimeError, .4, 2., 3.), + Alert( + "relayMalfunctionNoEntry", + "openpilot Unavailable", + "Harness Malfunction", + AlertStatus.normal, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.chimeError, .4, 2., 3.), + # permanent alerts Alert( "steerUnavailablePermanent", @@ -787,6 +801,13 @@ ALERTS = [ AlertStatus.normal, AlertSize.mid, Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2), + Alert( + "relayMalfunctionPermanent", + "Harness Malfunction", + "Please Check Hardware", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2), + Alert( "vehicleModelInvalid", "Vehicle Parameter Identification Failed", @@ -794,7 +815,6 @@ ALERTS = [ AlertStatus.normal, AlertSize.small, Priority.LOWEST, VisualAlert.steerRequired, AudibleAlert.none, .0, .0, .1), - # offroad alerts Alert( "ldwPermanent", "TAKE CONTROL",