From fed94c5d5778a296d3bff5878c29d6304c0e7570 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 25 Jan 2024 02:02:00 -0800 Subject: [PATCH] Toyota: use radar in place of abs for platform code ECUs (#31043) * use radar instead of abs * str the strenum * Lexus ES: non-TSS2 probably don't have stop and go without DSU-pull and/or pedal * remove from NO_STOP_TIMER_CAR. this set is so confusing * Combine ES & ESH (preferring ESH's DSU msgs) * ES: forgot substitute * comment * Highlander: combine, preferring the hybrid for DSU msg mismatches (0x365 and 0x366) * remove duplicates and sort * update docs * toyota non_essential ECU test * Lexus RX: combine, preferring hybrid's msgs (they all exist on ICE) * sort and remove dups * parameterize so we can test with notebook * this too * clean up * clean up * tuple makes more sense * update comments * update * update * update old-commit-hash: be15b31696af43accbffc8d59b3a5acbb4725682 --- selfdrive/car/toyota/values.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index a16864cce8..4f6e55b5d3 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -348,13 +348,16 @@ FW_LEN_CODE = re.compile(b'^[\x01-\x03]') # highest seen is 3 chunks, 16 bytes FW_CHUNK_LEN = 16 # List of ECUs that are most unique across openpilot platforms -# TODO: use hybrid ECU, splits similar ICE and hybrid variants # - fwdCamera: describes actual features related to ADAS. For example, on the Avalon it describes # when TSS-P became standard, whether the car supports stop and go, and whether it's TSS2. # On the RAV4, it describes the move to the radar doing ACC, and the use of LTA for lane keeping. -# - abs: differentiates hybrid/ICE on most cars (Corolla TSS2 is an exception) +# Note that the platform codes & major versions do not describe features in plain text, only with +# matching against other seen FW versions in the database they can describe features. +# - fwdRadar: sanity check against fwdCamera, commonly shares a platform code. +# For example the RAV4 2022's new radar architecture is shown for both with platform code. +# - abs: differentiates hybrid/ICE on most cars (Corolla TSS2 is an exception, not used due to hybrid platform combination) # - eps: describes lateral API changes for the EPS, such as using LTA for lane keeping and rejecting LKA messages -PLATFORM_CODE_ECUS = [Ecu.fwdCamera, Ecu.abs, Ecu.eps] +PLATFORM_CODE_ECUS = (Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps) # These platforms have at least one platform code for all ECUs shared with another platform. FUZZY_EXCLUDED_PLATFORMS: set[CAR] = set()