fix possible iso violation because it was unlimited while disengaged

pull/34943/head
Shane Smiskol 3 months ago
parent cfa24696d7
commit 83c882f850
  1. 8
      selfdrive/controls/controlsd.py

@ -114,11 +114,9 @@ class Controls:
actuators.accel = float(self.LoC.update(CC.longActive, CS, long_plan.aTarget, long_plan.shouldStop, pid_accel_limits)) actuators.accel = float(self.LoC.update(CC.longActive, CS, long_plan.aTarget, long_plan.shouldStop, pid_accel_limits))
# Steering PID loop and lateral MPC # Steering PID loop and lateral MPC
if CC.latActive: # Reset desired curvature to current to avoid violating the limits on engage
self.desired_curvature, curvature_limited = clip_curvature(CS.vEgo, self.desired_curvature, model_v2.action.desiredCurvature, lp.roll) desired_curvature = model_v2.action.desiredCurvature if CC.latActive else self.curvature
else: self.desired_curvature, curvature_limited = clip_curvature(CS.vEgo, self.desired_curvature, desired_curvature, lp.roll)
# Reset desired curvature to current to avoid violating the limits on engage
self.desired_curvature, curvature_limited = self.curvature, False
actuators.curvature = self.desired_curvature actuators.curvature = self.desired_curvature
steer, steeringAngleDeg, lac_log = self.LaC.update(CC.latActive, CS, self.VM, lp, steer, steeringAngleDeg, lac_log = self.LaC.update(CC.latActive, CS, self.VM, lp,

Loading…
Cancel
Save