cleanup no sensor data alert (#1760)

old-commit-hash: 264015c584
This commit is contained in:
Willem Melching
2020-06-22 14:27:07 -07:00
committed by GitHub
parent cf18830d3a
commit 6dc1c6e58e
4 changed files with 5 additions and 2 deletions

2
.gitignore vendored
View File

@@ -64,3 +64,5 @@ pandaextra
.mypy_cache/
flycheck_*
cppcheck_report.txt

2
cereal

Submodule cereal updated: c0c3cc16b2...8d5230e59b

View File

@@ -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:

View File

@@ -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