Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 29, 2024
1 parent 130458f commit 2a93460
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions opendbc/car/ford/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ def vRel(self):
return self._vRel


# TODO: linalg.norm faster?
def calc_dist(pt1, pt2):
return sum([(p1 - p2) ** 2 for p1, p2 in zip(pt1, pt2, strict=True)])


def cluster_points(pts: list[list[float]], max_dist: float):
if not len(pts):
return []
Expand All @@ -82,6 +77,7 @@ def cluster_points(pts: list[list[float]], max_dist: float):
cluster_sizes = [1]

for pt in pts[1:]:
# squared euclidean distance
cluster_dists = np.sum((np.array(cluster_means) - np.array(pt)) ** 2, axis=1)
closest_cluster = np.argmin(cluster_dists)

Expand Down

0 comments on commit 2a93460

Please sign in to comment.