pull/34531/head
Kacper Rączy 2 months ago
parent 3d1a895a4b
commit 341d27f666
  1. 7
      selfdrive/locationd/lagd.py

@ -246,9 +246,10 @@ class LagEstimator:
times, desired, actual, okay = self.points.get()
# check if there are any new valid data points since the last update
new_values_start_idx = next(-i for i, t in enumerate(reversed(times)) if t <= self.last_estimate_t)
if self.last_estimate_t != 0 and (new_values_start_idx == 0 or not np.any(okay[new_values_start_idx:])):
return
if self.last_estimate_t != 0:
new_values_start_idx = next(-i for i, t in enumerate(reversed(times)) if t <= self.last_estimate_t)
if (new_values_start_idx == 0 or not np.any(okay[new_values_start_idx:])):
return
delay, corr = self.actuator_delay(desired, actual, okay, self.dt)
if corr < self.min_ncc:

Loading…
Cancel
Save