From 83c882f850f6bbfe873679409efb3eb3a9599311 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 26 Mar 2025 22:26:26 -0700 Subject: [PATCH] fix possible iso violation because it was unlimited while disengaged --- selfdrive/controls/controlsd.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 20ac896dc8..7b39d602ae 100755 --- a/selfdrive/controls/controlsd.py +++ b/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)) # Steering PID loop and lateral MPC - if CC.latActive: - self.desired_curvature, curvature_limited = clip_curvature(CS.vEgo, self.desired_curvature, model_v2.action.desiredCurvature, lp.roll) - else: - # Reset desired curvature to current to avoid violating the limits on engage - self.desired_curvature, curvature_limited = self.curvature, False + # Reset desired curvature to current to avoid violating the limits on engage + desired_curvature = model_v2.action.desiredCurvature if CC.latActive else self.curvature + self.desired_curvature, curvature_limited = clip_curvature(CS.vEgo, self.desired_curvature, desired_curvature, lp.roll) actuators.curvature = self.desired_curvature steer, steeringAngleDeg, lac_log = self.LaC.update(CC.latActive, CS, self.VM, lp,