diff --git a/selfdrive/locationd/lagd.py b/selfdrive/locationd/lagd.py index 7bfa5b4397..62e623a1e8 100755 --- a/selfdrive/locationd/lagd.py +++ b/selfdrive/locationd/lagd.py @@ -121,7 +121,7 @@ class LagEstimator: self.t = t def points_valid(self): - return self.points.num_okay < int(self.okay_window_sec / self.dt) + return self.points.num_okay >= int(self.okay_window_sec / self.dt) def update_points(self): okay = self.lat_active and not self.steering_pressed and self.v_ego > self.min_vego and np.abs(self.yaw_rate) >= self.min_yr @@ -129,7 +129,7 @@ class LagEstimator: la_actual_pose = self.yaw_rate * self.v_ego self.points.update(self.t, la_desired, la_actual_pose, okay) - if not okay or self.points_valid(): + if not okay or not self.points_valid(): return times, desired, actual, okay = self.points.get() diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index c305bbc5bb..6df40ca851 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -401,7 +401,7 @@ def torqued_rcv_callback(msg, cfg, frame): return (frame - 1) == 0 or msg.which() == 'livePose' def lagd_rcv_callback(msg, cfg, frame): - return (frame - 1) == 0 or msg.which() == 'controlsState' + return (frame - 1) == 0 or msg.which() == 'livePose' def dmonitoringmodeld_rcv_callback(msg, cfg, frame):