Skip to content

Commit 5fbdbc1

Browse files
committed
vEgoStopping needs to be less than or equal to vEgoStarting to avoid state oscillation
1 parent 4fad454 commit 5fbdbc1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

selfdrive/controls/lib/longcontrol.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
LongCtrlState = car.CarControl.Actuators.LongControlState
99

10-
STOPPING_TARGET_SPEED = 0.31
11-
1210
# As per ISO 15622:2018 for all speeds
1311
ACCEL_MIN_ISO = -3.5 # m/s^2
1412
ACCEL_MAX_ISO = 2.0 # m/s^2
@@ -19,7 +17,7 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target_fut
1917
"""Update longitudinal control state machine"""
2018
stopping_condition = (v_ego < 2.0 and cruise_standstill) or \
2119
(v_ego < CP.vEgoStopping and
22-
(v_target_future < STOPPING_TARGET_SPEED or brake_pressed))
20+
(v_target_future < CP.vEgoStopping or brake_pressed))
2321

2422
starting_condition = v_target_future > CP.vEgoStarting and not cruise_standstill
2523

0 commit comments

Comments
 (0)