        ret.wheelbase = 2.67  # Average between 2.70 for sedan and 2.64 for hatchback
        ret.steerRatio = 13.9
        tire_stiffness_factor = 0.444  # not optimized yet
        ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG
        set_lat_tune(ret.lateralTuning, LatTunes.PID_D)
  
      elif candidate in (CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.LEXUS_ESH):
        stop_and_go = True
        ret.wheelbase = 2.8702
        ret.steerRatio = 16.0  # not optimized
 
</s> remove       set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4)
 </s> add       set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_TORQUE=2.5, FRICTION=0.06) </s> remove       set_lat_tune(ret.lateralTuning, LatTunes.LQR_RAV4)
 </s> add       set_lat_tune(ret.lateralTuning, LatTunes.TORQUE) </s> remove   STEER_DELTA_UP = 10       # 1.5s time to peak torque
  STEER_DELTA_DOWN = 25     # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
 </s> add  </s> remove     apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, CarControllerParams)
 </s> add     apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, self.torque_rate_limits) </s> remove def set_lat_tune(tune, name):
  if name == LatTunes.INDI_PRIUS:
 </s> add def set_lat_tune(tune, name, MAX_TORQUE=2.5, FRICTION=.1):
  if name == LatTunes.TORQUE:
    tune.init('torque')
    tune.torque.useSteeringAngle = True
    tune.torque.kp = 2.0 / MAX_TORQUE
    tune.torque.kf = 1.0 / MAX_TORQUE
    tune.torque.ki = 0.5 / MAX_TORQUE
    tune.torque.friction = FRICTION
  elif name == LatTunes.INDI_PRIUS:
      set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_TORQUE=3.0, FRICTION=0.08)
        ret.wheelbase = 2.67  # Average between 2.70 for sedan and 2.64 for hatchback
        ret.steerRatio = 13.9
        tire_stiffness_factor = 0.444  # not optimized yet
        ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG
      set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_TORQUE=3.0, FRICTION=0.08)
  
      elif candidate in (CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.LEXUS_ESH):
        stop_and_go = True
        ret.wheelbase = 2.8702
        ret.steerRatio = 16.0  # not optimized
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/car/toyota/interface.py