Skip to content

Commit

Permalink
sheesh fix dRel
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 30, 2024
1 parent 567b301 commit 15cc25e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions opendbc/car/ford/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@dataclass
class Cluster:
dRel: float = 0.0
dRelClosest: float = 0.0
yRel: float = 0.0
vRel: float = 0.0
trackId: int = 0
Expand Down Expand Up @@ -235,12 +234,12 @@ def _update_delphi_mrr(self):
vRel = sum(vRel) / len(vRel) / 2

# FIXME: creating capnp RadarPoint and accessing attributes are both expensive, so we store a dataclass and re-use the RadarPoint
self.clusters.append(Cluster(dRel=dRel, dRelClosest=min_dRel, yRel=yRel, vRel=vRel, trackId=track_id))
self.clusters.append(Cluster(dRel=dRel, yRel=yRel, vRel=vRel, trackId=track_id))

if idx not in self.pts:
self.pts[idx] = structs.RadarData.RadarPoint(measured=True, aRel=float('nan'), yvRel=float('nan'))

self.pts[idx].dRel = dRel
self.pts[idx].dRel = min_dRel
self.pts[idx].yRel = yRel
self.pts[idx].vRel = vRel
self.pts[idx].trackId = track_id
Expand Down

0 comments on commit 15cc25e

Please sign in to comment.