joystickd: use should_stop (#38421)

* param

* not really needed now
This commit is contained in:
Shane Smiskol
2026-07-22 16:07:43 -07:00
committed by GitHub
parent 1791057369
commit 05f42f752b
+2 -1
View File
@@ -9,6 +9,7 @@ from opendbc.car.vehicle_model import VehicleModel
from openpilot.common.realtime import DT_CTRL, Ratekeeper
from openpilot.common.params import Params
from openpilot.common.swaglog import cloudlog
from openpilot.selfdrive.controls.lib.drive_helpers import should_stop
LongCtrlState = car.CarControl.Actuators.LongControlState
MAX_LAT_ACCEL = 3.0
@@ -48,7 +49,7 @@ def joystickd_thread():
if CC.longActive:
actuators.accel = 4.0 * float(np.clip(joystick_axes[0], -1, 1))
actuators.longControlState = LongCtrlState.pid if sm['carState'].vEgo > 0.1 else LongCtrlState.stopping
actuators.longControlState = LongCtrlState.stopping if should_stop(sm['carState'].vEgo, actuators.accel) else LongCtrlState.pid
CC.cruiseControl.resume = actuators.accel > 0.0
if CC.latActive: