From 264015c584a0a010ba5f63af67da2e6bddebbea4 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 22 Jun 2020 14:27:07 -0700 Subject: [PATCH] cleanup no sensor data alert (#1760) --- .gitignore | 2 ++ cereal | 2 +- selfdrive/controls/controlsd.py | 2 +- selfdrive/locationd/locationd.py | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 31ced88ca9..b8d9a39b4a 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ pandaextra .mypy_cache/ flycheck_* + +cppcheck_report.txt diff --git a/cereal b/cereal index c0c3cc16b2..8d5230e59b 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit c0c3cc16b2ee2aafa7d13b67563463be663c240c +Subproject commit 8d5230e59b0ed7c93c66863d0cd19e5f180e417c diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 2798ec236d..3fbf4aa5dd 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -202,7 +202,7 @@ class Controls: self.events.add(EventName.commIssue) if not self.sm['pathPlan'].mpcSolutionValid: self.events.add(EventName.plannerError) - if not self.sm['liveLocationKalman'].inputsOK and os.getenv("NOSENSOR") is None: + if not self.sm['liveLocationKalman'].sensorsOK 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 (self.distance_traveled > 1000) and os.getenv("NOSENSOR") is None: diff --git a/selfdrive/locationd/locationd.py b/selfdrive/locationd/locationd.py index 155174aa60..cf621386dc 100755 --- a/selfdrive/locationd/locationd.py +++ b/selfdrive/locationd/locationd.py @@ -324,6 +324,7 @@ def locationd_thread(sm, pm, disabled_logs=None): msg.liveLocationKalman = localizer.liveLocationMsg(t * 1e-9) msg.liveLocationKalman.inputsOK = sm.all_alive_and_valid() + msg.liveLocationKalman.sensorsOK = sm.alive['sensorEvents'] and sm.valid['sensorEvents'] gps_age = (t / 1e9) - localizer.last_gps_fix msg.liveLocationKalman.gpsOK = gps_age < 1.0