          if (error >= 0 and (control <= steers_max or i < 0.0)) or \
             (error <= 0 and (control >= -steers_max or i > 0.0)):
            self.i_lqr = i
  
        self.output_steer = lqr_output + self.i_lqr
        self.output_steer = clip(self.output_steer, -steers_max, steers_max)
  
      check_saturation = (CS.vEgo > 10) and not CS.steeringRateLimited and not CS.steeringPressed
      saturated = self._check_saturation(self.output_steer, check_saturation, steers_max)
  
      lqr_log.steeringAngleDeg = angle_steers_k + lat_plan.angleOffsetDeg
 
</s> remove         error = self.angle_steers_des - angle_steers_k
 </s> add         error = desired_angle - angle_steers_k </s> remove     saturated = self._check_saturation(self.output_steer, check_saturation, steers_max)
 </s> add     saturated = self._check_saturation(output_steer, check_saturation, steers_max) </s> remove     lqr_log.steeringAngleDeg = angle_steers_k + lat_plan.angleOffsetDeg
 </s> add     lqr_log.steeringAngleDeg = angle_steers_k + params.angleOffsetAverageDeg </s> remove     lqr_log.output = self.output_steer
 </s> add     lqr_log.output = output_steer </s> remove       # Check if we deviated from the path
      left_deviation = actuators.steer > 0 and lat_plan.dPathPoints[0] < -0.1
      right_deviation = actuators.steer < 0 and lat_plan.dPathPoints[0] > 0.1
 </s> add 
      output_steer = lqr_output + self.i_lqr
      output_steer = clip(output_steer, -steers_max, steers_max)
          if (error >= 0 and (control <= steers_max or i < 0.0)) or \
             (error <= 0 and (control >= -steers_max or i > 0.0)):
            self.i_lqr = i
  
      output_steer = lqr_output + self.i_lqr
      output_steer = clip(output_steer, -steers_max, steers_max)
      output_steer = lqr_output + self.i_lqr
      output_steer = clip(output_steer, -steers_max, steers_max)
  
      check_saturation = (CS.vEgo > 10) and not CS.steeringRateLimited and not CS.steeringPressed
      saturated = self._check_saturation(self.output_steer, check_saturation, steers_max)
  
      lqr_log.steeringAngleDeg = angle_steers_k + lat_plan.angleOffsetDeg
keep keep keep keep replace replace keep keep keep keep keep
 LateralPlanner should only compute curvature (#20289)

* get curvature from planner

* no need to check active

* remove that

* remove self

* liveParams not needed

* cast

* fix test bug

* fixes

* fix ui.py

* fix radians

* update refs

* update refs

* bump cereal

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/controls/lib/latcontrol_lqr.py