|
|
@ -7,7 +7,6 @@ from selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR |
|
|
|
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 |
|
|
|
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 |
|
|
|
from selfdrive.car.interfaces import CarInterfaceBase |
|
|
|
from selfdrive.car.interfaces import CarInterfaceBase |
|
|
|
from selfdrive.car.disable_ecu import disable_ecu |
|
|
|
from selfdrive.car.disable_ecu import disable_ecu |
|
|
|
from selfdrive.controls.lib.latcontrol_torque import set_torque_tune |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ButtonType = car.CarState.ButtonEvent.Type |
|
|
|
ButtonType = car.CarState.ButtonEvent.Type |
|
|
|
EventName = car.CarEvent.EventName |
|
|
|
EventName = car.CarEvent.EventName |
|
|
@ -51,7 +50,6 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.stopAccel = 0.0 |
|
|
|
ret.stopAccel = 0.0 |
|
|
|
|
|
|
|
|
|
|
|
ret.longitudinalActuatorDelayUpperBound = 1.0 # s |
|
|
|
ret.longitudinalActuatorDelayUpperBound = 1.0 # s |
|
|
|
torque_params = CarInterfaceBase.get_torque_params(candidate) |
|
|
|
|
|
|
|
if candidate in (CAR.SANTA_FE, CAR.SANTA_FE_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022): |
|
|
|
if candidate in (CAR.SANTA_FE, CAR.SANTA_FE_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022): |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG |
|
|
|
ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG |
|
|
@ -66,7 +64,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.84 |
|
|
|
ret.wheelbase = 2.84 |
|
|
|
ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable |
|
|
|
ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
set_torque_tune(ret.lateralTuning, torque_params['LAT_ACCEL_FACTOR'], torque_params['FRICTION']) |
|
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) |
|
|
|
elif candidate == CAR.SONATA_LF: |
|
|
|
elif candidate == CAR.SONATA_LF: |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.mass = 4497. * CV.LB_TO_KG |
|
|
|
ret.mass = 4497. * CV.LB_TO_KG |
|
|
@ -96,13 +94,13 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.72 |
|
|
|
ret.wheelbase = 2.72 |
|
|
|
ret.steerRatio = 12.9 |
|
|
|
ret.steerRatio = 12.9 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
set_torque_tune(ret.lateralTuning, torque_params['LAT_ACCEL_FACTOR'], torque_params['FRICTION']) |
|
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) |
|
|
|
elif candidate == CAR.ELANTRA_HEV_2021: |
|
|
|
elif candidate == CAR.ELANTRA_HEV_2021: |
|
|
|
ret.mass = (3017. * CV.LB_TO_KG) + STD_CARGO_KG |
|
|
|
ret.mass = (3017. * CV.LB_TO_KG) + STD_CARGO_KG |
|
|
|
ret.wheelbase = 2.72 |
|
|
|
ret.wheelbase = 2.72 |
|
|
|
ret.steerRatio = 12.9 |
|
|
|
ret.steerRatio = 12.9 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
set_torque_tune(ret.lateralTuning, torque_params['LAT_ACCEL_FACTOR'], torque_params['FRICTION']) |
|
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) |
|
|
|
elif candidate == CAR.HYUNDAI_GENESIS: |
|
|
|
elif candidate == CAR.HYUNDAI_GENESIS: |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.mass = 2060. + STD_CARGO_KG |
|
|
|
ret.mass = 2060. + STD_CARGO_KG |
|
|
@ -204,7 +202,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.wheelbase = 2.80 |
|
|
|
ret.wheelbase = 2.80 |
|
|
|
ret.steerRatio = 13.75 |
|
|
|
ret.steerRatio = 13.75 |
|
|
|
tire_stiffness_factor = 0.5 |
|
|
|
tire_stiffness_factor = 0.5 |
|
|
|
set_torque_tune(ret.lateralTuning, torque_params['LAT_ACCEL_FACTOR'], torque_params['FRICTION']) |
|
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) |
|
|
|
elif candidate == CAR.KIA_STINGER: |
|
|
|
elif candidate == CAR.KIA_STINGER: |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.lateralTuning.pid.kf = 0.00005 |
|
|
|
ret.mass = 1825. + STD_CARGO_KG |
|
|
|
ret.mass = 1825. + STD_CARGO_KG |
|
|
@ -244,7 +242,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.noOutput), |
|
|
|
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.noOutput), |
|
|
|
get_safety_config(car.CarParams.SafetyModel.hyundaiHDA2)] |
|
|
|
get_safety_config(car.CarParams.SafetyModel.hyundaiHDA2)] |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
tire_stiffness_factor = 0.65 |
|
|
|
set_torque_tune(ret.lateralTuning, torque_params['LAT_ACCEL_FACTOR'], torque_params['FRICTION']) |
|
|
|
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) |
|
|
|
|
|
|
|
|
|
|
|
# Genesis |
|
|
|
# Genesis |
|
|
|
elif candidate == CAR.GENESIS_G70: |
|
|
|
elif candidate == CAR.GENESIS_G70: |
|
|
|