From 415c336c418bb7f14d1c1234ca624adc088d3e90 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 12 Jun 2020 16:03:35 -0700 Subject: [PATCH] no gps warning after 5 minutes (#1692) old-commit-hash: 684f7b2cc073010eb9e9cebfecbf1205be17d5a8 --- cereal | 2 +- selfdrive/controls/controlsd.py | 2 ++ selfdrive/controls/lib/events.py | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cereal b/cereal index b93b165a5c..d4d52a567b 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit b93b165a5c9de33325d7b01aa033073c978d1007 +Subproject commit d4d52a567bfd17a5130429657b341618ed657627 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 4f42eb804b..e03c2ed002 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -202,6 +202,8 @@ class Controls: if not self.sm['liveLocationKalman'].inputsOK and os.getenv("NOSENSOR") is None: if self.sm.frame > 5 / DT_CTRL: # Give locationd some time to receive all the inputs self.events.add(EventName.sensorDataInvalid) + if not self.sm['liveLocationKalman'].gpsOK and os.getenv("NOSENSOR") is None: + self.events.add(EventName.noGps) if not self.sm['pathPlan'].paramsValid: self.events.add(EventName.vehicleModelInvalid) if not self.sm['liveLocationKalman'].posenetOK: diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index e365dfc926..1e953cfbf3 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -517,6 +517,14 @@ EVENTS = { ET.NO_ENTRY: NoEntryAlert("No Data from Device Sensors"), }, + EventName.noGps: { + ET.PERMANENT: Alert( + "Poor GPS reception", + "Check GPS antenna placement", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., .2, creation_delay=300.), + }, + EventName.soundsUnavailable: { ET.PERMANENT: Alert( "Speaker not found",