|
|
|
@ -157,9 +157,9 @@ class Controls: |
|
|
|
|
self.VM = VehicleModel(self.CP) |
|
|
|
|
|
|
|
|
|
self.LaC: LatControl |
|
|
|
|
if self.CP.steerControlType == SteerControlType.angle: |
|
|
|
|
self.LaC = LatControlAngle(self.CP, self.CI) |
|
|
|
|
elif self.CP.lateralTuning.which() == 'pid': |
|
|
|
|
# if self.CP.steerControlType == SteerControlType.angle: |
|
|
|
|
# self.LaC = LatControlAngle(self.CP, self.CI) |
|
|
|
|
if self.CP.lateralTuning.which() == 'pid': |
|
|
|
|
self.LaC = LatControlPID(self.CP, self.CI) |
|
|
|
|
elif self.CP.lateralTuning.which() == 'indi': |
|
|
|
|
self.LaC = LatControlINDI(self.CP, self.CI) |
|
|
|
@ -619,8 +619,7 @@ class Controls: |
|
|
|
|
lac_log.saturated = abs(actuators.steer) >= 0.9 |
|
|
|
|
|
|
|
|
|
# Send a "steering required alert" if saturation count has reached the limit |
|
|
|
|
if (lac_log.active and not CS.steeringPressed and self.CP.steerControlType == SteerControlType.torque and |
|
|
|
|
self.CP.lateralTuning.which() == 'torque' and not self.joystick_mode): |
|
|
|
|
if (lac_log.active and not CS.steeringPressed and self.CP.lateralTuning.which() == 'torque' and not self.joystick_mode): |
|
|
|
|
undershooting = abs(lac_log.desiredLateralAccel) / abs(1e-3 + lac_log.actualLateralAccel) > 1.2 |
|
|
|
|
turning = abs(lac_log.desiredLateralAccel) > 1.0 |
|
|
|
|
good_speed = CS.vEgo > 5 |
|
|
|
@ -774,8 +773,8 @@ class Controls: |
|
|
|
|
lat_tuning = self.CP.lateralTuning.which() |
|
|
|
|
if self.joystick_mode: |
|
|
|
|
controlsState.lateralControlState.debugState = lac_log |
|
|
|
|
elif self.CP.steerControlType == SteerControlType.angle: |
|
|
|
|
controlsState.lateralControlState.angleState = lac_log |
|
|
|
|
# elif self.CP.steerControlType == SteerControlType.angle: |
|
|
|
|
# controlsState.lateralControlState.angleState = lac_log |
|
|
|
|
elif lat_tuning == 'pid': |
|
|
|
|
controlsState.lateralControlState.pidState = lac_log |
|
|
|
|
elif lat_tuning == 'torque': |
|
|
|
|