Skip to content

Commit

Permalink
Revert "is this faster?"
Browse files Browse the repository at this point in the history
This reverts commit 89f6cd3.
  • Loading branch information
sshane committed Oct 30, 2024
1 parent 89f6cd3 commit c8464ed
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions opendbc/car/ford/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def __init__(self, CP):

self.frame = 0
self.clusters2 = []
self.points = {}

# TODO: 2.5 good enough?
# TODO: write simple cluster function
Expand Down Expand Up @@ -207,28 +206,10 @@ def update(self, can_strings):
if not _update:
return None

ret.points = list(self.pts.values())
# ret.points = [structs.RadarData.RadarPoint(dRel=pt.dRelClosest, yRel=pt.yRel, vRel=pt.vRel, trackId=pt.trackId,
# measured=True, aRel=float('nan'), yvRel=float('nan'))
# for pt in self.clusters2]

a = set()
for pt in self.clusters2:
if pt.trackId not in self.points:
self.points[pt.trackId] = structs.RadarData.RadarPoint(measured=True, aRel=float('nan'), yvRel=float('nan'))

capnp_pt = self.points[pt.trackId]
capnp_pt.dRel = pt.dRelClosest
capnp_pt.yRel = pt.yRel
capnp_pt.vRel = pt.vRel
capnp_pt.trackId = pt.trackId
a.add(pt.trackId)

for track_id in self.points.keys():
if track_id not in a:
del self.points[track_id]

ret.points = list(self.points.values())
# ret.points = list(self.pts.values())
ret.points = [structs.RadarData.RadarPoint(dRel=pt.dRelClosest, yRel=pt.yRel, vRel=pt.vRel, trackId=pt.trackId,
measured=True, aRel=float('nan'), yvRel=float('nan'))
for pt in self.clusters2]
ret.errors = errors
return ret

Expand Down

0 comments on commit c8464ed

Please sign in to comment.