|
|
|
@ -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) |
|
|
|
|