From a49f9b74a50ad6276bc02a98cb3141523a63e386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Sun, 23 Mar 2025 22:35:55 -0700 Subject: [PATCH] Fix --- selfdrive/locationd/lagd.py | 4 ++-- selfdrive/test/process_replay/process_replay.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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):