From 1fa40400334755465ac9dfa1c0b315725489c9ef Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 29 Feb 2024 01:59:11 -0800 Subject: [PATCH] do the rest --- selfdrive/car/toyota/interface.py | 28 ---------------------------- selfdrive/car/toyota/values.py | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 7cee901072..4784f47698 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -46,10 +46,6 @@ class CarInterface(CarInterfaceBase): if candidate == CAR.PRIUS: stop_and_go = True - ret.wheelbase = 2.70 - ret.steerRatio = 15.74 # unknown end-to-end spec - ret.tireStiffnessFactor = 0.6371 # hand-tune - ret.mass = 3045. * CV.LB_TO_KG # Only give steer angle deadzone to for bad angle sensor prius for fw in car_fw: if fw.ecu == "eps" and not fw.fwVersion == b'8965B47060\x00\x00\x00\x00\x00\x00': @@ -61,18 +57,10 @@ class CarInterface(CarInterfaceBase): elif candidate in (CAR.RAV4, CAR.RAV4H): stop_and_go = True if (candidate in CAR.RAV4H) else False - ret.wheelbase = 2.65 - ret.steerRatio = 16.88 # 14.5 is spec end-to-end - ret.tireStiffnessFactor = 0.5533 - ret.mass = 3650. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2): stop_and_go = True - ret.wheelbase = 2.79 - ret.steerRatio = 16. # 14.8 is spec end-to-end ret.wheelSpeedFactor = 1.035 - ret.tireStiffnessFactor = 0.5533 - ret.mass = 4481. * CV.LB_TO_KG # mean between min and max elif candidate in (CAR.CHR, CAR.CHR_TSS2): stop_and_go = True @@ -83,25 +71,13 @@ class CarInterface(CarInterfaceBase): elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDER_TSS2): # TODO: TSS-P models can do stop and go, but unclear if it requires sDSU or unplugging DSU stop_and_go = True - ret.wheelbase = 2.8194 # average of 109.8 and 112.2 in - ret.steerRatio = 16.0 - ret.tireStiffnessFactor = 0.8 - ret.mass = 4516. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALON_TSS2): # starting from 2019, all Avalon variants have stop and go # https://engage.toyota.com/static/images/toyota_safety_sense/TSS_Applicability_Chart.pdf stop_and_go = candidate != CAR.AVALON - ret.wheelbase = 2.82 - ret.steerRatio = 14.8 # Found at https://pressroom.toyota.com/releases/2016+avalon+product+specs.download - ret.tireStiffnessFactor = 0.7983 - ret.mass = 3505. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.RAV4_TSS2, CAR.RAV4_TSS2_2022, CAR.RAV4_TSS2_2023): - ret.wheelbase = 2.68986 - ret.steerRatio = 14.3 - ret.tireStiffnessFactor = 0.7933 - ret.mass = 3585. * CV.LB_TO_KG # Average between ICE and Hybrid ret.lateralTuning.init('pid') ret.lateralTuning.pid.kiBP = [0.0] ret.lateralTuning.pid.kpBP = [0.0] @@ -126,10 +102,6 @@ class CarInterface(CarInterfaceBase): elif candidate in (CAR.LEXUS_NX, CAR.LEXUS_NX_TSS2): stop_and_go = True - ret.wheelbase = 2.66 - ret.steerRatio = 14.7 - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 4070 * CV.LB_TO_KG elif candidate == CAR.MIRAI: stop_and_go = True diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 453d8e1977..020facf66d 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -94,7 +94,7 @@ class CAR(Platforms): ToyotaCarInfo("Toyota Avalon 2017-18"), ], dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=3505. * CV.LB_TO_KG, wheelbase=2.82, steerRatio=14.8, tireStiffnessFactor=0.7983), ) AVALON_2019 = PlatformConfig( "TOYOTA AVALON 2019", @@ -179,7 +179,7 @@ class CAR(Platforms): ], dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), flags=ToyotaFlags.NO_STOP_TIMER, - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=4516. * CV.LB_TO_KG, wheelbase=2.8194, steerRatio=16.0, tireStiffnessFactor=0.8), ) HIGHLANDER_TSS2 = ToyotaTSS2PlatformConfig( "TOYOTA HIGHLANDER 2020", @@ -187,7 +187,7 @@ class CAR(Platforms): ToyotaCarInfo("Toyota Highlander 2020-23"), ToyotaCarInfo("Toyota Highlander Hybrid 2020-23"), ], - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=HIGHLANDER.specs, ) PRIUS = PlatformConfig( "TOYOTA PRIUS 2017", @@ -197,7 +197,7 @@ class CAR(Platforms): ToyotaCarInfo("Toyota Prius Prime 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), ], dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), - specs=CarSpecs(mass=3045. * CV.LB_TO_KG, wheelbase=2.70, steerRatio=15.74, tireStiffnessFactor=0.6371), + specs=CarSpecs(mass=3045. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.74, tireStiffnessFactor=0.6371), ) PRIUS_V = PlatformConfig( "TOYOTA PRIUS v 2017", @@ -221,7 +221,7 @@ class CAR(Platforms): ToyotaCarInfo("Toyota RAV4 2017-18") ], dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=3650. * CV.LB_TO_KG, wheelbase=2.65, steerRatio=16.88, tireStiffnessFactor=0.5533), ) RAV4H = PlatformConfig( "TOYOTA RAV4 HYBRID 2017", @@ -231,7 +231,7 @@ class CAR(Platforms): ], dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), flags=ToyotaFlags.NO_STOP_TIMER, - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=RAV4.specs, ) RAV4_TSS2 = ToyotaTSS2PlatformConfig( "TOYOTA RAV4 2019", @@ -239,7 +239,7 @@ class CAR(Platforms): ToyotaCarInfo("Toyota RAV4 2019-21", video_link="https://www.youtube.com/watch?v=wJxjDd42gGA"), ToyotaCarInfo("Toyota RAV4 Hybrid 2019-21"), ], - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=3585. * CV.LB_TO_KG, wheelbase=2.68986, steerRatio=14.3, tireStiffnessFactor=0.7933), ) RAV4_TSS2_2022 = ToyotaTSS2PlatformConfig( "TOYOTA RAV4 2022", @@ -249,7 +249,7 @@ class CAR(Platforms): ], dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), flags=ToyotaFlags.RADAR_ACC, - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=RAV4_TSS2.specs, ) RAV4_TSS2_2023 = ToyotaTSS2PlatformConfig( "TOYOTA RAV4 2023", @@ -259,7 +259,7 @@ class CAR(Platforms): ], dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), flags=ToyotaFlags.RADAR_ACC | ToyotaFlags.ANGLE_CONTROL, - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=RAV4_TSS2.specs, ) MIRAI = ToyotaTSS2PlatformConfig( "TOYOTA MIRAI 2021", # TSS 2.5 @@ -318,7 +318,7 @@ class CAR(Platforms): ToyotaCarInfo("Lexus NX Hybrid 2018-19"), ], dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=4070. * CV.LB_TO_KG, wheelbase=2.66, steerRatio=14.7, tireStiffnessFactor=0.444), ) LEXUS_NX_TSS2 = ToyotaTSS2PlatformConfig( "LEXUS NX 2020", @@ -326,7 +326,7 @@ class CAR(Platforms): ToyotaCarInfo("Lexus NX 2020-21"), ToyotaCarInfo("Lexus NX Hybrid 2020-21"), ], - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=LEXUS_NX.specs, ) LEXUS_LC_TSS2 = ToyotaTSS2PlatformConfig( "LEXUS LC 2024", @@ -350,7 +350,7 @@ class CAR(Platforms): ToyotaCarInfo("Lexus RX Hybrid 2017-19"), ], dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=CarSpecs(mass=4481. * CV.LB_TO_KG, wheelbase=2.79, steerRatio=16., tireStiffnessFactor=0.5533), ) LEXUS_RX_TSS2 = ToyotaTSS2PlatformConfig( "LEXUS RX 2020", @@ -358,7 +358,7 @@ class CAR(Platforms): ToyotaCarInfo("Lexus RX 2020-22"), ToyotaCarInfo("Lexus RX Hybrid 2020-22"), ], - specs=CarSpecs(mass=0000. * CV.LB_TO_KG, wheelbase=0, steerRatio=0, tireStiffnessFactor=0.444), + specs=LEXUS_RX.specs, ) LEXUS_GS_F = PlatformConfig( "LEXUS GS F 2016",