High speed alert (#1295)

* add speed to high alerts

* Add permanent alert

* Two lines

* No permanent alerts

* Less bad alert

* Typo
old-commit-hash: 3cb1568a54
commatwo_master
Willem Melching 5 years ago committed by GitHub
parent 7ca8cb85e9
commit aa8ca1819d
  1. 3
      selfdrive/controls/controlsd.py
  2. 15
      selfdrive/controls/lib/alerts.py

@ -116,6 +116,9 @@ def data_sample(CI, CC, sm, can_sock, state, mismatch_counter, can_error_counter
else: else:
events.append(create_event('calibrationInvalid', [ET.NO_ENTRY, ET.SOFT_DISABLE])) events.append(create_event('calibrationInvalid', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if CS.vEgo > 92 * CV.MPH_TO_MS:
events.append(create_event('speedTooHigh', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
# When the panda and controlsd do not agree on controls_allowed # When the panda and controlsd do not agree on controls_allowed
# we want to disengage openpilot. However the status from the panda goes through # we want to disengage openpilot. However the status from the panda goes through
# another socket other than the CAN messages and one can arrive earlier than the other. # another socket other than the CAN messages and one can arrive earlier than the other.

@ -503,6 +503,7 @@ ALERTS = [
AlertStatus.critical, AlertSize.full, AlertStatus.critical, AlertSize.full,
Priority.HIGHEST, VisualAlert.steerRequired, AudibleAlert.chimeWarningRepeat, 2.2, 3., 4.), Priority.HIGHEST, VisualAlert.steerRequired, AudibleAlert.chimeWarningRepeat, 2.2, 3., 4.),
# not loud cancellations (user is in control) # not loud cancellations (user is in control)
Alert( Alert(
"noTarget", "noTarget",
@ -518,6 +519,13 @@ ALERTS = [
AlertStatus.normal, AlertSize.mid, AlertStatus.normal, AlertSize.mid,
Priority.HIGH, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.), Priority.HIGH, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.),
Alert(
"speedTooHigh",
"Speed Too High",
"Slow down to resume operation",
AlertStatus.normal, AlertSize.mid,
Priority.HIGH, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.),
# Cancellation alerts causing non-entry # Cancellation alerts causing non-entry
Alert( Alert(
"overheatNoEntry", "overheatNoEntry",
@ -687,6 +695,13 @@ ALERTS = [
AlertStatus.normal, AlertSize.mid, AlertStatus.normal, AlertSize.mid,
Priority.LOW, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.), Priority.LOW, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.),
Alert(
"speedTooHighNoEntry",
"Speed Too High",
"Slow down to engage",
AlertStatus.normal, AlertSize.mid,
Priority.LOW, VisualAlert.none, AudibleAlert.chimeError, .4, 2., 3.),
# permanent alerts # permanent alerts
Alert( Alert(
"steerUnavailablePermanent", "steerUnavailablePermanent",

Loading…
Cancel
Save