fix no GPS alert when driving slowly in a tunnel (#31483)

old-commit-hash: d31269f663
pull/32199/head
Adeeb Shihadeh 1 year ago committed by GitHub
parent 42f292b3ce
commit d167a22be5
  1. 7
      selfdrive/controls/controlsd.py

@ -411,9 +411,12 @@ class Controls:
# TODO: fix simulator
if not SIMULATION or REPLAY:
if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1000):
# Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes
if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1000):
self.events.add(EventName.noGps)
if self.sm['liveLocationKalman'].gpsOK:
self.distance_traveled = 0
self.distance_traveled += CS.vEgo * DT_CTRL
if self.sm['modelV2'].frameDropPerc > 20:
self.events.add(EventName.modeldLagging)
@ -476,8 +479,6 @@ class Controls:
if ps.safetyModel not in IGNORED_SAFETY_MODES):
self.mismatch_counter += 1
self.distance_traveled += CS.vEgo * DT_CTRL
return CS
def state_transition(self, CS):

Loading…
Cancel
Save