joystick: fix long control state

pull/34410/head
Shane Smiskol 3 months ago
parent 733206fdd9
commit c515021576
  1. 2
      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)

Loading…
Cancel
Save