      # init state for next
      self.cur_state.x = 0.0
      self.cur_state.y = 0.0
      self.cur_state.psi = 0.0
      self.cur_state.curvature = interp(DT_MDL, self.t_idxs[:MPC_N+1], self.mpc_solution.curvature)
  
      # TODO this needs more thought, use .2s extra for now to estimate other delays
      delay = CP.steerActuatorDelay + .2
      current_curvature = self.mpc_solution.curvature[0]
      psi = interp(delay, self.t_idxs[:MPC_N+1], self.mpc_solution.psi)
 
</s> remove     psi = interp(delay, self.t_idxs[:MPC_N+1], self.mpc_solution.psi)
 </s> add     psi = interp(delay, self.t_idxs[:MPC_N + 1], self.mpc_solution.psi) </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 </s> remove     self.angle_steers_des = 0.0
    self.angle_steers_des_mpc = 0.0
    self.angle_steers_des_time = 0.0
 </s> add     self.desired_curvature = 0.0
    self.desired_curvature_rate = 0.0 </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   def update(self, sm, CP, VM):
 </s> add   def update(self, sm, CP):
    self.cur_state.curvature = interp(DT_MDL, self.t_idxs[:MPC_N + 1], self.mpc_solution.curvature)
      # init state for next
      self.cur_state.x = 0.0
      self.cur_state.y = 0.0
      self.cur_state.psi = 0.0
    self.cur_state.curvature = interp(DT_MDL, self.t_idxs[:MPC_N + 1], self.mpc_solution.curvature)
  
      # TODO this needs more thought, use .2s extra for now to estimate other delays
      delay = CP.steerActuatorDelay + .2
      current_curvature = self.mpc_solution.curvature[0]
      psi = interp(delay, self.t_idxs[:MPC_N+1], self.mpc_solution.psi)
keep keep keep keep 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/lateral_planner.py