From 17af9fcc5725e93ce0d5538fb22aaee84821a4ee Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 3 Jan 2022 13:34:21 -0800 Subject: [PATCH 1/3] Toyota: merge Lexus RX params --- selfdrive/car/toyota/interface.py | 33 ++++++------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 6c1f3e9f41a8df..f8f9f4168ebe7a 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -57,39 +57,18 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py ret.mass = 2860. * CV.LB_TO_KG + STD_CARGO_KG # mean between normal and hybrid set_lat_tune(ret.lateralTuning, LatTunes.PID_A) - elif candidate == CAR.LEXUS_RX: - stop_and_go = True - ret.wheelbase = 2.79 + elif candidate in [CAR.LEXUS_RX, CAR.LEXUS_RXH, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2]: + # TODO: which steerRatio? ret.steerRatio = 14.8 - tire_stiffness_factor = 0.5533 - ret.mass = 4387. * CV.LB_TO_KG + STD_CARGO_KG - set_lat_tune(ret.lateralTuning, LatTunes.PID_B) - - elif candidate == CAR.LEXUS_RXH: - stop_and_go = True - ret.wheelbase = 2.79 ret.steerRatio = 16. # 14.8 is spec end-to-end - tire_stiffness_factor = 0.444 # not optimized yet + ret.wheelSpeedFactor = 1.035 + tire_stiffness_factor = 0.5533 ret.mass = 4481. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max + # TODO: which tuning? they're slightly different + set_lat_tune(ret.lateralTuning, LatTunes.PID_B) set_lat_tune(ret.lateralTuning, LatTunes.PID_C) - - elif candidate == CAR.LEXUS_RX_TSS2: - stop_and_go = True - ret.wheelbase = 2.79 - ret.steerRatio = 14.8 - tire_stiffness_factor = 0.5533 # not optimized yet - ret.mass = 4387. * CV.LB_TO_KG + STD_CARGO_KG set_lat_tune(ret.lateralTuning, LatTunes.PID_D) - ret.wheelSpeedFactor = 1.035 - - elif candidate == CAR.LEXUS_RXH_TSS2: - stop_and_go = True - ret.wheelbase = 2.79 - ret.steerRatio = 16.0 # 14.8 is spec end-to-end - tire_stiffness_factor = 0.444 # not optimized yet - ret.mass = 4481.0 * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max set_lat_tune(ret.lateralTuning, LatTunes.PID_E) - ret.wheelSpeedFactor = 1.035 elif candidate in [CAR.CHR, CAR.CHRH]: stop_and_go = True From 3d4b7d2233c78bf24ed99607c6b06440215e02ee Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 3 Jan 2022 13:58:25 -0800 Subject: [PATCH 2/3] pick tuning --- selfdrive/car/toyota/interface.py | 6 ------ selfdrive/car/toyota/tunes.py | 8 -------- 2 files changed, 14 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index f8f9f4168ebe7a..e4e43d3fe22cf0 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -58,17 +58,11 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py set_lat_tune(ret.lateralTuning, LatTunes.PID_A) elif candidate in [CAR.LEXUS_RX, CAR.LEXUS_RXH, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2]: - # TODO: which steerRatio? - ret.steerRatio = 14.8 ret.steerRatio = 16. # 14.8 is spec end-to-end ret.wheelSpeedFactor = 1.035 tire_stiffness_factor = 0.5533 ret.mass = 4481. * CV.LB_TO_KG + STD_CARGO_KG # mean between min and max - # TODO: which tuning? they're slightly different - set_lat_tune(ret.lateralTuning, LatTunes.PID_B) set_lat_tune(ret.lateralTuning, LatTunes.PID_C) - set_lat_tune(ret.lateralTuning, LatTunes.PID_D) - set_lat_tune(ret.lateralTuning, LatTunes.PID_E) elif candidate in [CAR.CHR, CAR.CHRH]: stop_and_go = True diff --git a/selfdrive/car/toyota/tunes.py b/selfdrive/car/toyota/tunes.py index 15c8bbfcc69dd3..f26fc72a092bb9 100644 --- a/selfdrive/car/toyota/tunes.py +++ b/selfdrive/car/toyota/tunes.py @@ -80,10 +80,6 @@ def set_lat_tune(tune, name): tune.pid.kpV = [0.2] tune.pid.kiV = [0.05] tune.pid.kf = 0.00003 - elif name == LatTunes.PID_B: - tune.pid.kpV = [0.6] - tune.pid.kiV = [0.05] - tune.pid.kf = 0.00006 elif name == LatTunes.PID_C: tune.pid.kpV = [0.6] tune.pid.kiV = [0.1] @@ -92,10 +88,6 @@ def set_lat_tune(tune, name): tune.pid.kpV = [0.6] tune.pid.kiV = [0.1] tune.pid.kf = 0.00007818594 - elif name == LatTunes.PID_E: - tune.pid.kpV = [0.6] - tune.pid.kiV = [0.15] - tune.pid.kf = 0.00007818594 elif name == LatTunes.PID_F: tune.pid.kpV = [0.723] tune.pid.kiV = [0.0428] From 65282b286f969ac5fc080adad4321288622c1e37 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 3 Jan 2022 14:01:30 -0800 Subject: [PATCH 3/3] add those back --- selfdrive/car/toyota/interface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index e4e43d3fe22cf0..264f9d2aa070f6 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -58,6 +58,8 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=[]): # py set_lat_tune(ret.lateralTuning, LatTunes.PID_A) elif candidate in [CAR.LEXUS_RX, CAR.LEXUS_RXH, CAR.LEXUS_RX_TSS2, CAR.LEXUS_RXH_TSS2]: + stop_and_go = True + ret.wheelbase = 2.79 ret.steerRatio = 16. # 14.8 is spec end-to-end ret.wheelSpeedFactor = 1.035 tire_stiffness_factor = 0.5533