model lag warning (#2608)

pull/2610/head
Adeeb Shihadeh 4 years ago committed by GitHub
parent ec55dcc245
commit 2d7a194f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cereal
  2. 7
      selfdrive/controls/controlsd.py
  3. 8
      selfdrive/controls/lib/events.py

@ -1 +1 @@
Subproject commit 3d09a7508f9497d77c401d96f8086494a188d786
Subproject commit f1a9b228c6086eb444d60defb2d43d64ec1e2a94

@ -232,11 +232,14 @@ class Controls:
self.events.add(EventName.relayMalfunction)
if self.sm['plan'].fcw:
self.events.add(EventName.fcw)
if self.sm['model'].frameDropPerc > 2 and not SIMULATION:
self.events.add(EventName.modeldLagging)
if not self.sm.alive['frontFrame'] and (self.sm.frame > 5 / DT_CTRL) and not SIMULATION:
self.events.add(EventName.cameraMalfunction)
if self.sm['model'].frameDropPerc > 20 and not SIMULATION:
self.events.add(EventName.modeldLagging)
elif self.sm['model'].frameDropPerc > 2 and not SIMULATION:
self.events.add(EventName.modelLagWarning)
# Only allow engagement with brake pressed when stopped behind another stopped car
if CS.brakePressed and self.sm['plan'].vTargetFuture >= STARTING_TARGET_SPEED \
and self.CP.openpilotLongitudinalControl and CS.vEgo < 0.3:

@ -451,6 +451,14 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 1., 1.),
},
EventName.modelLagWarning: {
ET.WARNING: Alert(
"TAKE CONTROL",
"Driving Model Lagging",
AlertStatus.userPrompt, AlertSize.mid,
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 1., 1.),
},
EventName.fanMalfunction: {
ET.PERMANENT: NormalPermanentAlert("Fan Malfunction", "Contact Support"),
},

Loading…
Cancel
Save