    def reset(self):
      super().reset()
      self.pid.reset()
  
    def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate):
      pid_log = log.ControlsState.LateralPIDState.new_message()
      pid_log.steeringAngleDeg = float(CS.steeringAngleDeg)
      pid_log.steeringRateDeg = float(CS.steeringRateDeg)
  
      angle_steers_des_no_offset = math.degrees(VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll))
 
</s> remove   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate):
 </s> add   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk): </s> remove   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate):
 </s> add   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk): </s> remove   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate):
 </s> add   def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk): </s> remove                                                                              desired_curvature_rate)
 </s> add                                                                              desired_curvature_rate, self.sm['liveLocationKalman'])
  def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk):
    def reset(self):
      super().reset()
      self.pid.reset()
  
  def update(self, active, CS, CP, VM, params, last_actuators, desired_curvature, desired_curvature_rate, llk):
      pid_log = log.ControlsState.LateralPIDState.new_message()
      pid_log.steeringAngleDeg = float(CS.steeringAngleDeg)
      pid_log.steeringRateDeg = float(CS.steeringRateDeg)
  
      angle_steers_des_no_offset = math.degrees(VM.get_steer_from_curvature(-desired_curvature, CS.vEgo, params.roll))
keep keep keep keep replace keep keep keep keep keep
 Lateral torque-based control with roll on TSS2 corolla and TSSP rav4 (#24260)

* Initial commit

* Fix bugs

* Need more torque rate

* Cleanup cray cray control

* Write nicely

* Chiiil

* Not relevant for cray cray control

* Do some logging

* Seems like it has more torque than I thought

* Bit more feedforward

* Tune change

* Retune

* Retune

* Little more chill

* Add coroll

* Add corolla

* Give craycray a good name

* Update to proper logging

* D to the PI

* Should be in radians

* Add d

* Start oscillations

* Add D term

* Only change torque rate limits for new tune

* Add d logging

* Should be enough

* Wrong sign in D

* Downtune a little

* Needed to prevent faults

* Add lqr rav4 to tune

* Try derivative again

* Data based retune

* Data based retune

* add friction compensation

* Doesnt need too much P with friction comp

* remove lqr

* Remove kd

* Fix tests

* fix tests

* Too much error

* Get roll induced error under 1cm/deg

* Too much jitter

* Do roll comp

* Add ki

* Final update

* Update refs

* Cleanup latcontrol_torque a little more 
selfdrive/controls/lib/latcontrol_pid.py