Skip to content

Commit b48b8d3

Browse files
haraschaxCasey Francis
authored and
Casey Francis
committed
Latcontrol torque: max_torque rename (commaai#24265)
1 parent c085c7a commit b48b8d3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

selfdrive/car/toyota/interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py
5959
ret.steerRatio = 16.88 # 14.5 is spec end-to-end
6060
tire_stiffness_factor = 0.5533
6161
ret.mass = 3650. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid
62-
set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_TORQUE=2.5, FRICTION=0.06)
62+
set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_LAT_ACCEL=2.5, FRICTION=0.06)
6363

6464
elif candidate == CAR.COROLLA:
6565
ret.wheelbase = 2.70
@@ -143,7 +143,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py
143143
ret.steerRatio = 13.9
144144
tire_stiffness_factor = 0.444 # not optimized yet
145145
ret.mass = 3060. * CV.LB_TO_KG + STD_CARGO_KG
146-
set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_TORQUE=3.0, FRICTION=0.08)
146+
set_lat_tune(ret.lateralTuning, LatTunes.TORQUE, MAX_LAT_ACCEL=3.0, FRICTION=0.08)
147147

148148
elif candidate in (CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.LEXUS_ESH):
149149
stop_and_go = True

selfdrive/car/toyota/tunes.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ def set_long_tune(tune, name):
5151

5252

5353
###### LAT ######
54-
def set_lat_tune(tune, name, MAX_TORQUE=2.5, FRICTION=.1):
54+
def set_lat_tune(tune, name, MAX_LAT_ACCEL=2.5, FRICTION=.1):
5555
if name == LatTunes.TORQUE:
5656
tune.init('torque')
5757
tune.torque.useSteeringAngle = True
58-
tune.torque.kp = 2.0 / MAX_TORQUE
59-
tune.torque.kf = 1.0 / MAX_TORQUE
60-
tune.torque.ki = 0.5 / MAX_TORQUE
58+
tune.torque.kp = 2.0 / MAX_LAT_ACCEL
59+
tune.torque.kf = 1.0 / MAX_LAT_ACCEL
60+
tune.torque.ki = 0.5 / MAX_LAT_ACCEL
6161
tune.torque.friction = FRICTION
6262
elif name == LatTunes.INDI_PRIUS:
6363
tune.init('indi')

0 commit comments

Comments
 (0)