  
      steers_max = get_steer_max(CP, CS.vEgo)
      torque_scale = (0.45 + CS.vEgo / 60.0)**2  # Scale actuator model with speed
  
      steering_angle = CS.steeringAngleDeg
  
      # Subtract offset. Zero angle should correspond to zero torque
      self.angle_steers_des = lat_plan.steeringAngleDeg - lat_plan.angleOffsetDeg
      steering_angle -= lat_plan.angleOffsetDeg
  
      # Update Kalman filter
 
</s> remove     self.angle_steers_des = lat_plan.steeringAngleDeg - lat_plan.angleOffsetDeg
    steering_angle -= lat_plan.angleOffsetDeg
 </s> add     steering_angle_no_offset = CS.steeringAngleDeg - params.angleOffsetAverageDeg

    desired_angle = math.degrees(VM.get_steer_from_curvature(-lat_plan.curvature, CS.vEgo))

    instant_offset = params.angleOffsetDeg - params.angleOffsetAverageDeg
    desired_angle += instant_offset  # Only add offset that originates from vehicle model errors </s> remove       self.angle_steers_des = lat_plan.steeringAngleDeg # get from MPC/LateralPlanner

 </s> add  </s> remove       u_lqr = float(self.angle_steers_des / self.dc_gain - self.K.dot(self.x_hat))
 </s> add       u_lqr = float(desired_angle / self.dc_gain - self.K.dot(self.x_hat)) </s> remove     curvature_diff_from_psi = psi/(max(v_ego, 1e-1) * delay) - current_curvature
    next_curvature = current_curvature + 2*curvature_diff_from_psi
 </s> add     curvature_diff_from_psi = psi / (max(v_ego, 1e-1) * delay) - current_curvature
    next_curvature = current_curvature + 2 * curvature_diff_from_psi </s> remove         error = self.angle_steers_des - angle_steers_k
 </s> add         error = desired_angle - angle_steers_k
  
      steers_max = get_steer_max(CP, CS.vEgo)
      torque_scale = (0.45 + CS.vEgo / 60.0)**2  # Scale actuator model with speed
  


      # Subtract offset. Zero angle should correspond to zero torque
      self.angle_steers_des = lat_plan.steeringAngleDeg - lat_plan.angleOffsetDeg
      steering_angle -= lat_plan.angleOffsetDeg
  
      # Update Kalman filter
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