Skip to content

Commit

Permalink
long_mpc update, again!
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv committed Nov 14, 2024
1 parent 2e4ac5d commit 596fb43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
FCW_IDXS = T_IDXS < 5.0
T_DIFFS = np.diff(T_IDXS, prepend=[0.])
COMFORT_BRAKE = 2.5
STOP_DISTANCE = 5.5
STOP_DISTANCE = 5.0

def get_jerk_factor(personality=custom.LongitudinalPersonalitySP.standard):
if personality==custom.LongitudinalPersonalitySP.relaxed:
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_stopped_equivalence_factor(v_lead, v_ego):
if np.all(v_lead - v_ego > 0):
v_diff_offset = ((v_lead - v_ego) * 1.)
v_diff_offset = np.clip(v_diff_offset, 0, STOP_DISTANCE / 2)
v_diff_offset = np.maximum(v_diff_offset * ((10 - v_ego)/10), 0)
v_diff_offset = np.maximum(v_diff_offset * ((15 - v_ego)/15), 0)
distance = (v_lead**2) / (2 * COMFORT_BRAKE) + v_diff_offset
return distance

Expand Down

0 comments on commit 596fb43

Please sign in to comment.