Skip to content

Commit 0e35796

Browse files
committed
should_stop: less creepy
1 parent 5dcaf3b commit 0e35796

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

selfdrive/controls/lib/drive_helpers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@ def clip_curvature(v_ego, prev_curvature, new_curvature, roll) -> tuple[float, b
3939
return float(new_curvature), limited_accel or limited_max_curv
4040

4141

42-
def get_accel_from_plan(speeds, accels, t_idxs, action_t=DT_MDL, vEgoStopping=0.05):
42+
def get_accel_from_plan(speeds, accels, t_idxs, action_t=DT_MDL, vEgoStopping=0.1):
4343
if len(speeds) == len(t_idxs):
4444
v_now = speeds[0]
4545
a_now = accels[0]
4646
v_target = np.interp(action_t, t_idxs, speeds)
4747
a_target = 2 * (v_target - v_now) / (action_t) - a_now
48-
v_target_1sec = np.interp(action_t + 1.0, t_idxs, speeds)
4948
else:
5049
v_target = 0.0
51-
v_target_1sec = 0.0
5250
a_target = 0.0
5351
should_stop = (v_target < vEgoStopping and
54-
v_target_1sec < vEgoStopping)
52+
a_target < 0.2) # even teslas cannot a<0.2 when starting from stop
5553
return a_target, should_stop
5654

5755
def curv_from_psis(psi_target, psi_rate, vego, action_t):

0 commit comments

Comments
 (0)