-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ford: use platform codes to fuzzy fingerprint #31124
Conversation
TODO: write scripts/tests (print platform codes and version ranges etc.) May close commaai#31052
From the route 83a4e056c7072678/2023-11-13--16-51-33 (which is already in selfdrive/car/tests/routes.py, added in commaai#30691).
514890e
to
636d4e7
Compare
great work! I love how this is mostly just our other fuzzy FP functions; it mostly works for all brands. With verification, I made sure that:
Let me know if you have any other verification step ideas |
I found some VINs for Ford Explorers online (most of our FW PRs are for those) and used https://motorcraft.com/AsBuilt to download information about them (ECU configuration, part numbers and FW versions). I collected 44 VINs and data. Here are the results of running the current OP fingerprint vs running with the custom fuzzy matcher: Of the 15 newly fingerprinted VINs, 100% were previously failing to fingerprint due to missing Engine FWs. For example, Of the 21 VINs which continue to not match, three of these (MY17 and MY19) did not have any camera or radar part numbers/fw. The other 18 did have cameras but did not have radars. |
9d4c631
to
636d4e7
Compare
I wonder how many matches we gain just by removing engine!
So with a perfect fuzzy matcher, we still expect none of these to match? Ie. they all have LKAS but not ACC as stock? |
Yes pretty much. Looking at the cars which are fingerprinting in more detail, there is a car which shouldn't be compatible which is matching right now, without the custom fuzzy matcher. For example this 2020 Ford Explorer XLT (
Note it doesn't have a radar. It fingerprints anyway, I think because fuzzy matching requires just two matching ECUs.
Since camera/radar/eps are excluded from fuzzy, it's the abs and engine FW matching the database. Both were added in fd2e03d. Looking at that PR, the 2020 Explorer Limited (
Show full resultsVIN Comment Fingerprint Fuzzy NewFingerprint NewFuzzy FactoryACC FactoryTJA Result 23 1FMSK8DHXLGBXXXXXX 2020 Ford Explorer XLT FORD EXPLORER 6TH GEN False FORD EXPLORER 6TH GEN False RadarFusion On fp -> fp 25 1FM5K8GC0LGAXXXXXX 2020 Ford Explorer ST FORD EXPLORER 6TH GEN False FORD EXPLORER 6TH GEN False RadarFusion On fp -> fp 39 1FM5K8GC3LGAXXXXXX 2020 Ford Explorer ST FORD EXPLORER 6TH GEN False FORD EXPLORER 6TH GEN False RadarFusion On fp -> fp 41 1FMSK8DH0NGBXXXXXX 2022 Ford Explorer XLT 4WD FORD EXPLORER 6TH GEN False FORD EXPLORER 6TH GEN False RadarFusion On fp -> fp 6 1FMSK8DH1LGBXXXXXX 2020 Ford Explorer XLT FORD EXPLORER 6TH GEN True FORD EXPLORER 6TH GEN True Off (no radar) Off fp -> fp 8 1FMSK8DH7NGBXXXXXX 2022 Ford Explorer XLT FORD EXPLORER 6TH GEN True FORD EXPLORER 6TH GEN True Off (no radar) Off fp -> fp 10 1FMSK8DH6NGBXXXXXX 2022 Ford Explorer XLT FORD EXPLORER 6TH GEN True FORD EXPLORER 6TH GEN True Off (no radar) Off fp -> fp 17 1FMSK8DH9NGBXXXXXX 2022 Ford Explorer XLT FORD EXPLORER 6TH GEN True FORD EXPLORER 6TH GEN True Off (no radar) Off fp -> fp 11 1FMSK8FH7NGAXXXXXX 2022 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 12 1FMSK7FHXPGAXXXXXX 2023 Ford Explorer Limited RWD mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 15 1FMSK8DH9LGBXXXXXX 2020 Ford Explorer XLT 4WD mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 20 1FMSK8FH9MGAXXXXXX 2021 Ford Explorer Limited 4WD mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 21 1FMSK8DH1LGBXXXXXX 2020 Ford Explorer XLT mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 22 1FMSK8DH1LGDXXXXXX 2020 Ford Explorer XLT mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 24 1FMSK8DHXLGAXXXXXX 2020 Ford Explorer XLT mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 26 1FMSK8FH2MGBXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 27 1FMSK8FHXMGBXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 28 1FMSK8FH2MGBXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 29 1FMSK8FH8MGBXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 31 1FMSK8FH5MGAXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 32 1FMSK8FH4MGBXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 33 1FMSK8FH5MGAXXXXXX 2021 Ford Explorer Limited mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 38 1FMSK8DH5MGAXXXXXX 2021 Ford Explorer XLT mock False FORD EXPLORER 6TH GEN True RadarFusion On mock -> fp 0 1FMSK8DH1NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 1 1FMSK8DH7MGCXXXXXX 2021 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 2 1FMSK8DH9MGBXXXXXX 2021 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 3 1FMSK8DH4NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 4 1FMSK8DH8MGAXXXXXX 2021 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 5 1FMSK8DH3NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 7 1FMSK8DH8NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 9 1FMSK8DH9LGBXXXXXX 2020 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 13 1FMSK8DH0NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 14 1FMSK8DH9LGCXXXXXX 2020 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 16 1FMSK8DH6NGBXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 18 1FMSK8DH0NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 19 1FM5K8D83KGAXXXXXX 2019 Ford Explorer XLT mock False mock False no camera no camera mock -> mock 30 1FMSK8DH1LGCXXXXXX 2020 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 34 1FMSK7DH5LGAXXXXXX 2020 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 35 1FM5K8D8XHGCXXXXXX 2017 Ford Explorer XLT 4WD mock False mock False no camera no camera mock -> mock 36 1FMSK8DH0LGBXXXXXX 2020 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 37 1FMSK8DH4MGAXXXXXX 2021 Ford Explorer mock False mock False Off (no radar) Off mock -> mock 40 1FM5K8GT6HGDXXXXXX 2017 Ford Explorer Sport mock False mock False no camera no camera mock -> mock 42 1FMSK8DH1NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock 43 1FMSK8DH5NGAXXXXXX 2022 Ford Explorer XLT mock False mock False Off (no radar) Off mock -> mock |
I think we should pick a subset of ECUs to care about, and ignore the rest. This random Bronco does not fingerprint because the engine version is out of range (we pick radar and camera on Hyundai and radar camera and EPS on Toyota): d1aacbb70e8a9d4b|2024-01-27--09-47-46 |
A heads up, alot of us are running this UDS fix commaai/panda#1524 to get CANFD responses. I'm not sure you've tested this with some Mazda data, but I found shared ECUs. |
ABS and IPMA are the best for uniquely matching, and the radar is always required
This reverts commit b7baeac.
@@ -0,0 +1,30 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a common script that takes brand eventually
… NOTE: NOTE THAT WE remove the separation for the different platform code model year hint ranges, I don't see that being a problem
* Ford: use platform codes to fuzzy fingerprint TODO: write scripts/tests (print platform codes and version ranges etc.) May close commaai#31052 * get_platform_codes: fix return type * add print_platform_codes.py script * print_platform_codes: sort versions * match_fw_to_car_fuzzy: use set comprehension, and fix typo * Ford: add missing Mach-E fw From the route 83a4e056c7072678/2023-11-13--16-51-33 (which is already in selfdrive/car/tests/routes.py, added in commaai#30691). * add ford_fuzzy_fingerprint.ipynb notebook * get_platform_codes: use regex to parse firmware * test_ford: test_platform_codes_fuzzy_fw * test_ford: use get_platform_codes in test_fw_versions * match_fw_to_car_fuzzy: improve comments * test_ford: add test_platform_codes_spot_check * test_ford: add test_match_fw_fuzzy * remove comment from notebook * TestFordFW: remove engine ECU FW * update print_platform_codes.py * remove part number (unecessary) * platform codes can just use platform hint and model year - software revision not useful * fuzzy FP on the platform hint and model year hint range * fix platform codes test * update notebook * add notebook * explain model year hint better * test part numbers again * cleanup notebooks * remove notebook * cleanup match_fw_to_car_fuzzy and add comments * update comment * . * Revert "remove notebook" This reverts commit 5d4ca20. * add notebook back * remove PSCM from PLATFORM_CODE_ECUS ABS and IPMA are the best for uniquely matching, and the radar is always required * Revert "remove PSCM from PLATFORM_CODE_ECUS" This reverts commit b7baeac. * fix from merge * more fixes revert * FW_RE -> FW_PATTERN * this can actually be set * conventions * just add * convention * refactor matcher, this brings it more in line with Hyundai. IMPORTANT NOTE: NOTE THAT WE remove the separation for the different platform code model year hint ranges, I don't see that being a problem * better/smaller test * add test to catch overlapping platform codes * remove nb * not now --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
Use the FW prefix to identify the model and model year/generation of the vehicle.
Notes:
Verification
Future improvements
May close #31052
Platform codes (platform + model year hints)