diff --git a/cereal b/cereal index 3d09a7508f..f1a9b228c6 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 3d09a7508f9497d77c401d96f8086494a188d786 +Subproject commit f1a9b228c6086eb444d60defb2d43d64ec1e2a94 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 32266813f2..b92a65ab74 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -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 \ diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index d0b10ec84e..b1a6b78058 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -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"), },