From 07e4129edc5ebb870037c1a44d8a33a2faf8a98a Mon Sep 17 00:00:00 2001 From: ShaneSmiskol Date: Tue, 1 Jun 2021 12:41:24 -0700 Subject: [PATCH] Split Avalon 2016-18 and Avalon 2019+ (#21058) * start to separate Avalon 2019+ * reverts #20824 (2020)... and removes fw from a 2020 avalon * revert 2020 fw from #20241 * revert 2021 fw from #19790 * bump opendbc, add smartDsu * Add only removed fw from listed PRs above and from jryan's 2020 * bump opendbc to master * comment out any non-original avalon fw * new fw * these 2016 (5 byte EPS_STATUS msg) Avalon fws are correct. comment out any 2019+ fw I haven't seen yet * Add to release files * these are good too * nothing on 7e0 yet * both have their engines on one address * validated remaining fws! some from adeeb's, chris's, and kumar's PRs * Add test route for Avalon 2019 * horrible * Duplicate * use nodsu dbc. Only difference is the addition of some signals that don't work, and max of BRAKE_PRESSURE is different * Enablem 2019 Avalon test route --- selfdrive/car/fw_versions.py | 2 +- selfdrive/car/toyota/interface.py | 2 +- selfdrive/car/toyota/values.py | 40 +++++++++++++++++++++---------- selfdrive/test/test_routes.py | 1 + 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 6ad40a2f08..d3057c28bb 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -221,7 +221,7 @@ def match_fw_to_car_exact(fw_versions_dict): continue # On some Toyota models, the engine can show on two different addresses - if ecu_type == Ecu.engine and candidate in [TOYOTA.CAMRY, TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS, TOYOTA.AVALON] and found_version is None: + if ecu_type == Ecu.engine and candidate in [TOYOTA.CAMRY, TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS] and found_version is None: continue # Ignore non essential ecus diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 19ae0accac..22e43934dc 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -176,7 +176,7 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.18], [0.015]] # community tuning ret.lateralTuning.pid.kf = 0.00012 # community tuning - elif candidate == CAR.AVALON: + elif candidate in [CAR.AVALON, CAR.AVALON_2019]: stop_and_go = False ret.safetyParam = 73 ret.wheelbase = 2.82 diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 27bf1970f8..9f03caf005 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -36,6 +36,7 @@ class CAR: HIGHLANDERH = "TOYOTA HIGHLANDER HYBRID 2018" HIGHLANDERH_TSS2 = "TOYOTA HIGHLANDER HYBRID 2020" AVALON = "TOYOTA AVALON 2016" + AVALON_2019 = "TOYOTA AVALON 2019" RAV4_TSS2 = "TOYOTA RAV4 2019" COROLLA_TSS2 = "TOYOTA COROLLA TSS2 2019" COROLLAH_TSS2 = "TOYOTA COROLLA HYBRID TSS2 2019" @@ -265,39 +266,53 @@ FW_VERSIONS = { CAR.AVALON: { (Ecu.esp, 0x7b0, None): [ b'F152607060\x00\x00\x00\x00\x00\x00', - b'F152607110\x00\x00\x00\x00\x00\x00', - b'F152607140\x00\x00\x00\x00\x00\x00', - b'F152607171\x00\x00\x00\x00\x00\x00', - b'F152607180\x00\x00\x00\x00\x00\x00', ], (Ecu.dsu, 0x791, None): [ b'881510701300\x00\x00\x00\x00', - b'881510703200\x00\x00\x00\x00', b'881510705100\x00\x00\x00\x00', b'881510705200\x00\x00\x00\x00', ], (Ecu.eps, 0x7a1, None): [ b'8965B41051\x00\x00\x00\x00\x00\x00', - b'8965B41080\x00\x00\x00\x00\x00\x00', - b'8965B41090\x00\x00\x00\x00\x00\x00', ], (Ecu.engine, 0x7e0, None): [ b'\x0230721100\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x0230721200\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00', ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'8821F4702000\x00\x00\x00\x00', + b'8821F4702100\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'8646F0701100\x00\x00\x00\x00', + b'8646F0703000\x00\x00\x00\x00', + ], + }, + CAR.AVALON_2019: { + (Ecu.esp, 0x7b0, None): [ + b'F152607140\x00\x00\x00\x00\x00\x00', + b'F152607171\x00\x00\x00\x00\x00\x00', + b'F152607110\x00\x00\x00\x00\x00\x00', + b'F152607180\x00\x00\x00\x00\x00\x00', + ], + (Ecu.dsu, 0x791, None): [ + b'881510703200\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'8965B41080\x00\x00\x00\x00\x00\x00', + b'8965B07010\x00\x00\x00\x00\x00\x00', + b'8965B41090\x00\x00\x00\x00\x00\x00', + ], (Ecu.engine, 0x700, None): [ b'\x01896630735100\x00\x00\x00\x00', + b'\x01896630725300\x00\x00\x00\x00', b'\x01896630738000\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ - b'8821F4702000\x00\x00\x00\x00', - b'8821F4702100\x00\x00\x00\x00', b'8821F4702300\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ - b'8646F0701100\x00\x00\x00\x00', b'8646F0702100\x00\x00\x00\x00', - b'8646F0703000\x00\x00\x00\x00', ], }, CAR.CAMRY: { @@ -810,7 +825,7 @@ FW_VERSIONS = { }, CAR.HIGHLANDERH: { (Ecu.eps, 0x7a1, None): [ - b'8965B48160\x00\x00\x00\x00\x00\x00' + b'8965B48160\x00\x00\x00\x00\x00\x00', ], (Ecu.esp, 0x7b0, None): [ b'F152648541\x00\x00\x00\x00\x00\x00', @@ -1639,6 +1654,7 @@ DBC = { CAR.HIGHLANDERH: dbc_dict('toyota_highlander_hybrid_2018_pt_generated', 'toyota_adas'), CAR.HIGHLANDERH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'), CAR.AVALON: dbc_dict('toyota_avalon_2017_pt_generated', 'toyota_adas'), + CAR.AVALON_2019: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), CAR.RAV4_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), CAR.COROLLA_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), CAR.COROLLAH_TSS2: dbc_dict('toyota_nodsu_hybrid_pt_generated', 'toyota_tss2_adas'), diff --git a/selfdrive/test/test_routes.py b/selfdrive/test/test_routes.py index 92c6dbd1da..e26c0a5c26 100755 --- a/selfdrive/test/test_routes.py +++ b/selfdrive/test/test_routes.py @@ -86,6 +86,7 @@ routes = [ TestRoute("82e9cdd3f43bf83e|2021-05-15--02-42-51", HYUNDAI.ELANTRA_2021), TestRoute("000cf3730200c71c|2021-05-24--10-42-05", TOYOTA.AVALON), + TestRoute("0bb588106852abb7|2021-05-26--12-22-01", TOYOTA.AVALON_2019), TestRoute("6cdecc4728d4af37|2020-02-23--15-44-18", TOYOTA.CAMRY), TestRoute("3456ad0cd7281b24|2020-12-13--17-45-56", TOYOTA.CAMRY_TSS2), TestRoute("ffccc77938ddbc44|2021-01-04--16-55-41", TOYOTA.CAMRYH_TSS2),