cleanup no sensor data alert (#1760)

pull/1763/head
Willem Melching 5 years ago committed by GitHub
parent fa7b5d38b8
commit 264015c584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 2
      cereal
  3. 2
      selfdrive/controls/controlsd.py
  4. 1
      selfdrive/locationd/locationd.py

2
.gitignore vendored

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

@ -1 +1 @@
Subproject commit c0c3cc16b2ee2aafa7d13b67563463be663c240c Subproject commit 8d5230e59b0ed7c93c66863d0cd19e5f180e417c

@ -202,7 +202,7 @@ class Controls:
self.events.add(EventName.commIssue) self.events.add(EventName.commIssue)
if not self.sm['pathPlan'].mpcSolutionValid: if not self.sm['pathPlan'].mpcSolutionValid:
self.events.add(EventName.plannerError) 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 if self.sm.frame > 5 / DT_CTRL: # Give locationd some time to receive all the inputs
self.events.add(EventName.sensorDataInvalid) self.events.add(EventName.sensorDataInvalid)
if not self.sm['liveLocationKalman'].gpsOK and (self.distance_traveled > 1000) and os.getenv("NOSENSOR") is None: if not self.sm['liveLocationKalman'].gpsOK and (self.distance_traveled > 1000) and os.getenv("NOSENSOR") is None:

@ -324,6 +324,7 @@ def locationd_thread(sm, pm, disabled_logs=None):
msg.liveLocationKalman = localizer.liveLocationMsg(t * 1e-9) msg.liveLocationKalman = localizer.liveLocationMsg(t * 1e-9)
msg.liveLocationKalman.inputsOK = sm.all_alive_and_valid() 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 gps_age = (t / 1e9) - localizer.last_gps_fix
msg.liveLocationKalman.gpsOK = gps_age < 1.0 msg.liveLocationKalman.gpsOK = gps_age < 1.0

Loading…
Cancel
Save