set curvature in joystickd (#34668)

* set curvature in joystickd

* Update joystickd.py

* Update joystickd.py
This commit is contained in:
Shane Smiskol
2025-02-22 01:43:00 -08:00
committed by GitHub
parent a8e416abbe
commit e9aa331f0f

View File

@@ -62,6 +62,11 @@ def joystickd_thread():
cs_msg.valid = True
controlsState = cs_msg.controlsState
controlsState.lateralControlState.init('debugState')
lp = sm['liveParameters']
steer_angle_without_offset = math.radians(sm['carState'].steeringAngleDeg - lp.angleOffsetDeg)
controlsState.curvature = -VM.calc_curvature(steer_angle_without_offset, sm['carState'].vEgo, lp.roll)
pm.send('controlsState', cs_msg)
rk.keep_time()