Skip to content

Commit

Permalink
use multiplication more
Browse files Browse the repository at this point in the history
suggested by twilsonco
  • Loading branch information
morrislee authored Jan 12, 2023
1 parent 0317915 commit 2ea299b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selfdrive/controls/lib/radar_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ def get_RadarState(self, model_prob=0.0):
def get_RadarState_from_vision(self, lead_msg, v_ego, vision_v_ego):
# Learn vision model velocity error to correct vlead and alead
if v_ego > 0 and vision_v_ego > 0:
vision_velocity_error = vision_v_ego / v_ego
corrected_v_lead = lead_msg.v[0] / vision_velocity_error
corrected_a_lead = lead_msg.a[0] / vision_velocity_error
vision_velocity_factor = v_ego / vision_v_ego
corrected_v_lead = lead_msg.v[0] * vision_velocity_factor
corrected_a_lead = lead_msg.a[0] * vision_velocity_factor
#if no v_ego or vision_v_ego set, fallback to uncalibrated values
else:
corrected_v_lead = lead_msg.v[0]
Expand Down

0 comments on commit 2ea299b

Please sign in to comment.