diff --git a/selfdrive/locationd/helpers.py b/selfdrive/locationd/helpers.py index a3e3ae4a8..dd8b5dfb9 100644 --- a/selfdrive/locationd/helpers.py +++ b/selfdrive/locationd/helpers.py @@ -80,6 +80,14 @@ class PointBuckets: def is_valid(self) -> bool: individual_buckets_valid = all(len(v) >= min_pts for v, min_pts in zip(self.buckets.values(), self.buckets_min_points.values(), strict=True)) total_points_valid = self.__len__() >= self.min_points_total + + if not individual_buckets_valid: + for bounds, (bucket, min_pts) in zip(self.x_bounds, zip(self.buckets.values(), self.buckets_min_points.values())): + if len(bucket) < min_pts: + print(f"Bucket {bounds} is invalid: has {len(bucket)} points, requires at least {min_pts} points.") + if not total_points_valid: + print(f"Total points are invalid: has {self.__len__()} points, requires at least {self.min_points_total} points.") + return individual_buckets_valid and total_points_valid def is_calculable(self) -> bool: