Show relay malfunction alert (#1373)

* show relay malfunction alert

* Remove empty line

* Also immediate disengage

* Forgot noEntry

* Fix name
old-commit-hash: 2b2751c6bd
commatwo_master
Willem Melching 5 years ago committed by GitHub
parent 32b3e3e3aa
commit e07d6c35b1
  1. 3
      selfdrive/controls/controlsd.py
  2. 22
      selfdrive/controls/lib/alerts.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:

@ -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",

Loading…
Cancel
Save