7
7
from selfdrive .car import STD_CARGO_KG , create_button_enable_events , create_button_event , scale_rot_inertia , scale_tire_stiffness , gen_empty_fingerprint , get_safety_config
8
8
from selfdrive .car .interfaces import CarInterfaceBase
9
9
from selfdrive .car .disable_ecu import disable_ecu
10
- from selfdrive .controls .lib .latcontrol_torque import set_torque_tune
11
10
12
11
ButtonType = car .CarState .ButtonEvent .Type
13
12
EventName = car .CarEvent .EventName
@@ -51,7 +50,6 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
51
50
ret .stopAccel = 0.0
52
51
53
52
ret .longitudinalActuatorDelayUpperBound = 1.0 # s
54
- torque_params = CarInterfaceBase .get_torque_params (candidate )
55
53
if candidate in (CAR .SANTA_FE , CAR .SANTA_FE_2022 , CAR .SANTA_FE_HEV_2022 , CAR .SANTA_FE_PHEV_2022 ):
56
54
ret .lateralTuning .pid .kf = 0.00005
57
55
ret .mass = 3982. * CV .LB_TO_KG + STD_CARGO_KG
@@ -66,7 +64,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
66
64
ret .wheelbase = 2.84
67
65
ret .steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable
68
66
tire_stiffness_factor = 0.65
69
- set_torque_tune ( ret .lateralTuning , torque_params [ 'LAT_ACCEL_FACTOR' ], torque_params [ 'FRICTION' ] )
67
+ CarInterfaceBase . configure_torque_tune ( candidate , ret .lateralTuning )
70
68
elif candidate == CAR .SONATA_LF :
71
69
ret .lateralTuning .pid .kf = 0.00005
72
70
ret .mass = 4497. * CV .LB_TO_KG
@@ -96,13 +94,13 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
96
94
ret .wheelbase = 2.72
97
95
ret .steerRatio = 12.9
98
96
tire_stiffness_factor = 0.65
99
- set_torque_tune ( ret .lateralTuning , torque_params [ 'LAT_ACCEL_FACTOR' ], torque_params [ 'FRICTION' ] )
97
+ CarInterfaceBase . configure_torque_tune ( candidate , ret .lateralTuning )
100
98
elif candidate == CAR .ELANTRA_HEV_2021 :
101
99
ret .mass = (3017. * CV .LB_TO_KG ) + STD_CARGO_KG
102
100
ret .wheelbase = 2.72
103
101
ret .steerRatio = 12.9
104
102
tire_stiffness_factor = 0.65
105
- set_torque_tune ( ret .lateralTuning , torque_params [ 'LAT_ACCEL_FACTOR' ], torque_params [ 'FRICTION' ] )
103
+ CarInterfaceBase . configure_torque_tune ( candidate , ret .lateralTuning )
106
104
elif candidate == CAR .HYUNDAI_GENESIS :
107
105
ret .lateralTuning .pid .kf = 0.00005
108
106
ret .mass = 2060. + STD_CARGO_KG
@@ -204,7 +202,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
204
202
ret .wheelbase = 2.80
205
203
ret .steerRatio = 13.75
206
204
tire_stiffness_factor = 0.5
207
- set_torque_tune ( ret .lateralTuning , torque_params [ 'LAT_ACCEL_FACTOR' ], torque_params [ 'FRICTION' ] )
205
+ CarInterfaceBase . configure_torque_tune ( candidate , ret .lateralTuning )
208
206
elif candidate == CAR .KIA_STINGER :
209
207
ret .lateralTuning .pid .kf = 0.00005
210
208
ret .mass = 1825. + STD_CARGO_KG
@@ -244,7 +242,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[], disabl
244
242
ret .safetyConfigs = [get_safety_config (car .CarParams .SafetyModel .noOutput ),
245
243
get_safety_config (car .CarParams .SafetyModel .hyundaiHDA2 )]
246
244
tire_stiffness_factor = 0.65
247
- set_torque_tune ( ret .lateralTuning , torque_params [ 'LAT_ACCEL_FACTOR' ], torque_params [ 'FRICTION' ] )
245
+ CarInterfaceBase . configure_torque_tune ( candidate , ret .lateralTuning )
248
246
249
247
# Genesis
250
248
elif candidate == CAR .GENESIS_G70 :
0 commit comments