longcontrol: enter stopping state immediately (#26879)

* enter stopping state immediately

* Update selfdrive/controls/lib/longcontrol.py
This commit is contained in:
Shane Smiskol
2023-01-10 13:02:43 -08:00
committed by GitHub
parent 9e364ff76f
commit 4e9bddee5c
+1 -3
View File
@@ -30,10 +30,8 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target,
long_control_state = LongCtrlState.off
else:
if long_control_state == LongCtrlState.off:
if long_control_state in (LongCtrlState.off, LongCtrlState.pid):
long_control_state = LongCtrlState.pid
elif long_control_state == LongCtrlState.pid:
if stopping_condition:
long_control_state = LongCtrlState.stopping