      pid_log.steeringRateDeg = float(CS.steeringRateDeg)
  
      if CS.vEgo < 0.3 or not active:
        output_steer = 0.0
        pid_log.active = False
        self.pid.reset()
 
</s> remove   def update(self, active, CS, CP, lat_plan):
 </s> add   def update(self, active, CS, CP, VM, params, lat_plan): </s> remove       self.angle_steers_des = lat_plan.steeringAngleDeg # get from MPC/LateralPlanner

 </s> add  </s> remove       self.output_steer = lqr_output + self.i_lqr
      self.output_steer = clip(self.output_steer, -steers_max, steers_max)
 </s> add       output_steer = lqr_output + self.i_lqr
      output_steer = clip(output_steer, -steers_max, steers_max) </s> remove     # reset to current steer angle if not active or overriding
    if active:
      curvature_desired = next_curvature
      desired_curvature_rate = next_curvature_rate
    else:
      curvature_desired = measured_curvature
      desired_curvature_rate = 0.0

    # negative sign, controls uses different convention
    self.desired_steering_wheel_angle_deg = -float(math.degrees(curvature_desired * VM.sR)/curvature_factor) + steering_wheel_angle_offset_deg
    self.desired_steering_wheel_angle_rate_deg = -float(math.degrees(desired_curvature_rate * VM.sR)/curvature_factor)
 </s> add     self.desired_curvature = next_curvature
    self.desired_curvature_rate = next_curvature_rate
    angle_steers_des_no_offset = math.degrees(VM.get_steer_from_curvature(-lat_plan.curvature, CS.vEgo))
    angle_steers_des = angle_steers_des_no_offset + params.angleOffsetDeg

      pid_log.steeringRateDeg = float(CS.steeringRateDeg)
  
    angle_steers_des_no_offset = math.degrees(VM.get_steer_from_curvature(-lat_plan.curvature, CS.vEgo))
    angle_steers_des = angle_steers_des_no_offset + params.angleOffsetDeg

      if CS.vEgo < 0.3 or not active:
        output_steer = 0.0
        pid_log.active = False
        self.pid.reset()
keep add 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_pid.py