      if not self.joystick_mode:
        # accel PID loop
        pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_kph * CV.KPH_TO_MS)
        t_since_plan = (self.sm.frame - self.sm.rcv_frame['longitudinalPlan']) * DT_CTRL
        actuators.accel = self.LoC.update(CC.longActive, CS, self.CP, long_plan, pid_accel_limits, t_since_plan)
  
        # Steering PID loop and lateral MPC
        desired_curvature, desired_curvature_rate = get_lag_adjusted_curvature(self.CP, CS.vEgo,
                                                                               lat_plan.psis,
                                                                               lat_plan.curvatures,
 
</s> remove       actuators.steer, actuators.steeringAngleDeg, lac_log = self.LaC.update(CC.latActive, CS, self.CP, self.VM,
                                                                             params, self.last_actuators, desired_curvature,
 </s> add       actuators.steer, actuators.steeringAngleDeg, lac_log = self.LaC.update(CC.latActive, CS, self.VM, params,
                                                                             self.last_actuators, desired_curvature, </s> remove   def update(self, active, CS, CP, long_plan, accel_limits, t_since_plan):
 </s> add   def update(self, active, CS, long_plan, accel_limits, t_since_plan): </s> remove       if not CS.standstill or output_accel > CP.stopAccel:
        output_accel -= CP.stoppingDecelRate * DT_CTRL
 </s> add       if not CS.standstill or output_accel > self.CP.stopAccel:
        output_accel -= self.CP.stoppingDecelRate * DT_CTRL </s> remove   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk):
 </s> add   def update(self, active, CS, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk): </s> remove                              k_f = CP.longitudinalTuning.kf, rate=1 / DT_CTRL)
 </s> add                              k_f=CP.longitudinalTuning.kf, rate=1 / DT_CTRL)
      actuators.accel = self.LoC.update(CC.longActive, CS, long_plan, pid_accel_limits, t_since_plan)
      if not self.joystick_mode:
        # accel PID loop
        pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_kph * CV.KPH_TO_MS)
        t_since_plan = (self.sm.frame - self.sm.rcv_frame['longitudinalPlan']) * DT_CTRL
      actuators.accel = self.LoC.update(CC.longActive, CS, long_plan, pid_accel_limits, t_since_plan)
  
        # Steering PID loop and lateral MPC
        desired_curvature, desired_curvature_rate = get_lag_adjusted_curvature(self.CP, CS.vEgo,
                                                                               lat_plan.psis,
                                                                               lat_plan.curvatures,
keep keep keep keep replace keep keep keep keep keep
 Clean up controllers (#24340)

* clean up lat controllers

* pass CP once

* sort 
selfdrive/controls/controlsd.py