Skip to content

Commit

Permalink
todos
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 26, 2024
1 parent 7e238aa commit 207ac53
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions opendbc/car/ford/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def __init__(self, CP):

self.frame = 0

# TODO: 2.5 good enough?
self.dbscan = DBSCAN(eps=5, min_samples=1)

self.fig, self.ax = plt.subplots()
Expand Down Expand Up @@ -263,11 +264,13 @@ def _update_delphi_mrr(self):
print('working on cluster', (dRel, yRel, vRel))

closest_previous_cluster = None
closest_euclidean_dist = 999999999
closest_euclidean_dist = None
print('searching! ...')
for idx, c in enumerate(self.clusters):
# if c.cluster_id in taken_clusters:
# continue
# TODO: need to re-enable this
# TODO: some clusters might not match optimally with this, but maybe rare enough?
if c.cluster_id in taken_clusters:
continue

# if this new cluster is close to any previous ones, use its previous cluster id with the new points and mark the old cluster as used
print('comparing with prev cluster', (c.dRel, c.yRel, c.vRel))
Expand Down Expand Up @@ -315,7 +318,7 @@ def _update_delphi_mrr(self):
# print('track_id', self.track_id)
# print('cluster_id', self.cluster_id)

if PLOT := True:
if PLOT := False:
self.ax.clear()

colors = [cmap(c.cluster_id % 20) for c in self.clusters]
Expand All @@ -332,7 +335,7 @@ def _update_delphi_mrr(self):
self.ax.legend()
self.ax.set_xlim(0, 180)
self.ax.set_ylim(-30, 30)
plt.pause(1/2)
plt.pause(1/100)

self.pts = {}
for i, cluster in enumerate(self.clusters):
Expand Down

0 comments on commit 207ac53

Please sign in to comment.