Skip to content

Commit

Permalink
radard/update: optimize capnp (commaai#23380)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanlee authored Jan 4, 2022
1 parent c70fc7d commit 7b612d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions selfdrive/controls/radard.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ def update(self, sm, rr, enable_lead):
radarState.carStateMonoTime = sm.logMonoTime['carState']

if enable_lead:
if len(sm['modelV2'].leadsV3) > 1:
radarState.leadOne = get_lead(self.v_ego, self.ready, clusters, sm['modelV2'].leadsV3[0], low_speed_override=True)
radarState.leadTwo = get_lead(self.v_ego, self.ready, clusters, sm['modelV2'].leadsV3[1], low_speed_override=False)
leads_v3 = sm['modelV2'].leadsV3
if len(leads_v3) > 1:
radarState.leadOne = get_lead(self.v_ego, self.ready, clusters, leads_v3[0], low_speed_override=True)
radarState.leadTwo = get_lead(self.v_ego, self.ready, clusters, leads_v3[1], low_speed_override=False)
return dat


Expand Down

0 comments on commit 7b612d4

Please sign in to comment.