model lag warning (#2608)

old-commit-hash: 2d7a194f9fd5e5b26b55e3aa9e33efc95c97be6e
This commit is contained in:
Adeeb Shihadeh
2020-11-23 13:42:18 -08:00
committed by GitHub
parent aa790c3395
commit d2710f2fcf
3 changed files with 15 additions and 4 deletions
+1 -1
Submodule cereal updated: 3d09a7508f...f1a9b228c6
+6 -3
View File
@@ -232,10 +232,13 @@ 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)
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 \
+8
View File
@@ -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"),
},