From c5150215762099526e8d518f8ce53923d59ed812 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 16 Jan 2025 16:07:56 -0800 Subject: [PATCH] joystick: fix long control state --- tools/joystick/joystickd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/joystick/joystickd.py b/tools/joystick/joystickd.py index 8348ad82b5..d52e80af86 100755 --- a/tools/joystick/joystickd.py +++ b/tools/joystick/joystickd.py @@ -9,6 +9,7 @@ from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel +LongCtrlState = car.CarControl.Actuators.LongControlState MAX_LAT_ACCEL = 2.5 @@ -46,6 +47,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 > CP.vEgoStopping else LongCtrlState.stopping if CC.latActive: max_curvature = MAX_LAT_ACCEL / max(sm['carState'].vEgo ** 2, 5)