Commit Graph

116 Commits

Author SHA1 Message Date
Cameron Clough
85c9fea5d8 Ford: use platform codes to fuzzy fingerprint (#31124)
* Ford: use platform codes to fuzzy fingerprint

TODO: write scripts/tests (print platform codes and version ranges etc.)

May close #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 #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 5d4ca202f2a23601d5c829204119f36a58f2b451.

* 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 b7baeac19c18b5aa0c31da52f12054f4bae6e1ff.

* 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>
2024-05-07 20:28:59 -07:00
Cameron Clough
7bc81341e1 Ford: add Ranger 2024 (CAN FD, dashcam only) (#31956)
* Ford: add Ranger 2024 (CAN FD, dashcam only)

* force fingerprint

* debug

* add FW (using debug_fw_fingerprinting_offline)

* add test route

* Revert "debug"

This reverts commit 9d128cb1bbb28fb0cb8da6725c291ebe285e7467.

* Revert "force fingerprint"

This reverts commit 421d92172f354b4713a1371bec9dc9b1bbb6318f.

* update package and finalise steer ratio

"Adaptive Cruise Control with Lane Centering" is part of the Raptor
Standard Equipment Group (i.e. only on the Raptor trim). However,
looking at As-Built/VIN data for Raptor LARIATs show that although Ford
does not advertise it they do come with Lane Centering (the configurator
only says they have ACC with Stop and Go).

ACC with Stop and Go can also be added to the lower XLT trim as part of
the Technology Package, but it is unclear at this point whether that
includes Lane Centering.

The 2021 Ranger had a 17.0 steer ratio. The As-Built data suggests
17/18. PlotJuggler shows the liveParameters.steerRatio between 16.5-17.5
on two short drives.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-04-14 18:00:34 -07:00
Justin Newberry
b0eb3ba4f4 cars: platform enums -> prepend brand name (#31927)
* with brand name

* migrate

* Fix

* fixes

* more

* passes

* fix

* fix the doc

* collects

* these too

* more stuff

* body exception :/

* more

* hardcode i guess

* update ref

* toyota

* more toyota

* and here

* final!

* fix notebooks and ccs

* move this here
2024-03-19 17:29:50 -07:00
thenhnn
489528dcae PlatformConfig: automatically get platform_str from the enum name (#31868)
* get platform_str from the enum name

* fix tests

* add migration table

* remove impossible todo

* Add link to PR in MIGRATION table

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN

* rename RAM_HD to RAM_HD_5TH_GEN

* rename references to RAM_HD and RAM_1500

* change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC

* remove MOCK from fingerprints.py

* change hard-coded car model in test_can_fingerprint.py/test_timing

* migration

* update ref

* space

* prius

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: justin newberry <justin@comma.ai>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
2024-03-19 11:16:02 -07:00
Justin Newberry
0b92f4e9ee more car info -> car docs (#31885) 2024-03-17 16:53:57 -07:00
Shane Smiskol
5746c4672d Ford: hybrid docs (#31874)
* kinda works

* fix

* clean up

* rm hybrid entries

* shorter

* shorter

* fix that

* one line!

* we can get rid of this now!
2024-03-15 15:37:29 -07:00
Justin Newberry
655e5f7c3e rename CarInfo to CarDocs (#31879)
car info to car docs
2024-03-15 11:45:44 -07:00
Shane Smiskol
bdae188c6f docs: don't support multi-type car info (#31875)
don't support multi-type car info
2024-03-15 00:11:41 -07:00
RandomHB
fedb2a9360 Update fingerprints.py 2022 Ford F-150 PowerBoost (fwdCamera) (#31462)
* Update fingerprints.py 2022 Ford F-150 PowerBoost (fwdCamera)

* update MY

* also likely works for hybrid

* fix that

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-03-11 22:17:10 -07:00
GRIFFIT807
adc15d69a2 Add support for 2024 Ford Maverick (#31828)
* Update fingerprints.py

* Update values.py

* 24

* Update CARS.md

* hybrid should match up

---------

Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-03-11 21:31:53 -07:00
Yasushi Oh
1589adddf1 bugfix: add support for Bronco Sport 2023 (#31794)
* bugfix: add support for Bronco Sport 2023

* Apply suggestions from code review

* update docs

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-03-08 21:49:12 -08:00
Shane Smiskol
99610c8819 Revert "common PlatformFlags base class + test for < 32 bits" (#31793)
Revert "common PlatformFlags base class + test for < 32 bits (#31779)"

This reverts commit 8ba5d660f3.
2024-03-08 00:15:21 -08:00
Justin Newberry
8ba5d660f3 common PlatformFlags base class + test for < 32 bits (#31779)
* add 32 bit check

* space

* this is not required

* jk yes we do
2024-03-07 14:01:28 -08:00
Shane Smiskol
78a46ce724 car values formatting (#31747)
values formatting
2024-03-06 15:47:44 -08:00
Justin Newberry
25ccb2426c cars: remove CAR_INFO map (#31739)
* no carinfo map

* smaller diff

* not on mock
2024-03-06 11:22:12 -08:00
Justin Newberry
b0eae8c1b7 platformconfig and carspecs are now required, carspecs no longer kwarg (#31667)
* required

* mock can be a platform!

* default is mock

* fix that

* and that one
2024-03-01 11:31:51 -08:00
Cameron Clough
341b81c0a5 Ford: use flags for CANFD (#31664) 2024-03-01 12:18:03 -05:00
Justin Newberry
3a6c3315ab Subaru: move to flags within PlatformConfig (#31584)
* flags

* update ref

* use the flags directly

* use post_init (don't freeze)

* we can maintain frozen with custom class

* not preglobal

* move to common

* cleanup
2024-02-28 20:12:14 -08:00
Shea_D
4cec88c029 Ford - Add OBDC Cable Length to CarPartList (#31608)
* Update comma cable requirement for Ford CANFD

* Adding Long_Cable to part list

* Moving cable info into doc_definitions under CarHarness

* Updating parts for ford_q4

* Updating Q3 info

* Updated MachE with USBC coupler

* fix typo

* updating docs/cars.md

* Add 3X angled no cable

* Adding in nocable device package

* Add missing )

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

* Generating new Docs.MD

* Added threex_nocable for MachE

* Swap MachE to regular mount no cable

* confirmed with Comma Operations all boxes include 1.5ft cable regardless of 9.5ft selection

* Updating CarInfo

* Update USB_Coupler for Q4 Harness

* Remove cable from import

* removed ]

* Disagree with the inconsistency but OK

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update selfdrive/car/ford/values.py

---------

Co-authored-by: sheaduncan <sduncan@Yeti-PC>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-02-28 17:07:06 -08:00
Cameron Clough
0e41bf3474 Ford: fix As-Built request identifier (#31609)
Should be 0xDE00 not 0xDE
2024-02-27 10:59:27 -08:00
Cameron Clough
c724d1c86c Ford: log interesting module configuration data (#31569)
* Ford: log interesting module configuration data

Ford ECUs have what is called "As-Built Data" which is configured at the
factory/workshop to set what packages/features are enabled on the car.
But they also contain vehicle specific information (VIN, make, model,
weight, wheel base...), DTC information and driver preferences.

I dumped the CAN traffic for the FORScan diagnostic tool to see how it
requests this information from the ECUs.

<details>
<summary>FORScan communication with IPMA (camera)</summary>
<pre>
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': '0200'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'TESTER_PRESENT', 'hex': '00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'TESTER_PRESENT', 'hex': '00'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f190'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f113'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x13JX7T-19H406-CH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1134a5837542d3139483430362d434800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f188'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x88JX7T-14F397-AH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1884a5837542d3134463339372d414800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f120'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1 JX7T-14F397-BF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1204a5837542d3134463339372d424600000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f121'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f124'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1$JX7T-14F398-AG\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1244a5837542d3134463339382d414700000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f125'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1%JX7T-14F398-BF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1254a5837542d3134463339382d424600000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f126'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f10a'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f111'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x11JX7T-14F403-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1114a5837542d3134463430332d434100000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f18c'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x8c182762191\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f18c31383237363231393100000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f162'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f110'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x10DS-JX7T-19H406-AD\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f11044532d4a5837542d3139483430362d414400000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': '0202'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd100'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd10001'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd700'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd70001010101'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd701'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'd70101020000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'dd01'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'dd010102f8'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'f113'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'data': b'\xf1\x13JX7T-19H406-CH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'hex': 'f1134a5837542d3139483430362d434800000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd08'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd0800000500500100300000000000000000000000300000000000000000200100400300100200001200f00300500000000000000300c00b00400200000000000000000000000000000000200f01201e01501400a00200200400700d02501d01700700e06405005e05503401100a000000002002002001000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd09'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'fd09ffec0001fef60002'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DTC_INFORMATION', 'hex': '028f'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DTC_INFORMATION', 'hex': '02ff50019768c253002cc401862cc418862c'}
... skip DTC requests ...
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de00020799dbaa10296516a440000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de01'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de01fd5616db5fffff557fe1f842080000000800000008000000080000000819bfe00f7c00000000000000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de02'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de02800000008000000080000000800000008337fc00800000008000000080000000800000008337fc0000000000000000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de03'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de03fffc26c3800000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de04'}
{'addr': 1806, 'type': 'positive_response', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de04546a8c0000000000'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de05'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de06'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de07'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de08'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de09'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0a'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0b'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0c'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0d'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
{'addr': 1798, 'type': 'request', 'service': 'READ_DATA_BY_IDENTIFIER', 'hex': 'de0e'}
{'addr': 1806, 'type': 'negative_response', 'hex': '2231'}
</pre>
</details>

Using UDS service `READ_DATA_BY_IDENTIFIER`, we can read the As-Built
blocks from `0xDExx` with no diagnostic session/security access necessary.

I used [Online As-Built databases](https://cyanlabs.net/asbuilt-db/) and
various coding spreadsheets shared online to find values we might be
interested in using for fingerprinting (both vehicle parameters and
identifying the platform).

ABS:
- Payload tier (Base, Mid Payload Upgrade, Heavy Duty Payload
  Upgrade...)
- Wheelbase
- Steering ratio
- Cruise Control Mode (Normal, Adaptive)
- Enable Stop and Go

PSCM:
- Enable Lane Keeping Aid
- Enable Traffic Jam Assist
- Enable Lane Centering Assist

IPMA (Q4):
- Steering ratio
- Wheelbase

APIM (Sync 3 and Sync 4):
- Steering ratio
- Vehicle weight
- Wheelbase

There are more potentially useful signals which I haven't included
although they might not be necessary:
- Vehicle (Ford platform code, like "C344" or "C519" - although the
  source of the mapping from index to code is FORScan and not Ford
themselves unless we can find a better source).
- Fuel type
- Vehicle length/height/front track/rear track
- Tire circumference (could be useful for converting wheel speed rad/s
  to m/s)
- Steering angle source (Pinion, Wheel)
- Country code (letters, e.g. US, CA or UK)
- Transmission type
- CAN network architecture
- More feature flags (the APIM also stores settings for ACC, LCA, BLIS)

The full list of settings I have found is
[here](https://github.com/incognitojam/op-notebooks/blob/main/ford/settings.py).

* FwQueryConfig: add data_requests

* add car_data to CarInterface get_params

* Revert "add car_data to CarInterface get_params"

This reverts commit aa161a6b82082705db97bea2c4317e1888a74845.

* test_ford: add APIM ecu address

* Revert "FwQueryConfig: add data_requests"

This reverts commit dc5484a9b80be5bc61a7fdf55560b8813bc43ef7.

* fix block numbers and add extra queries

* bump test_fw_query_timing

* add missing query whitelists

* simplify asbuilt requests

* use forscan block ids

* formatting

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-02-27 04:22:10 -08:00
Justin Newberry
9ecff49118 platformconfig: freeze all dataclasses (#31605)
* frozen

* frozen
2024-02-26 21:16:05 -08:00
Cameron Clough
8e03cdfc2a Ford: move to PlatformConfig (#31554)
* Ford: move to PlatformConfig

* Align Aviator model years with Explorer

* Add CarSpecs to PlatformConfig

---------

Co-authored-by: justin <justin@comma.ai>
2024-02-25 17:55:42 -08:00
Cameron Clough
995250ae49 use pyupgrade to update to new typing syntax (#31580)
* add pyupgrade hook

* run pyupgrade (pre-commit run -a)

* ruff --fix

* Revert "add pyupgrade hook"

This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.

* revert changes to third_party/

* manual type fixes

* explicit Optional wrapping capnp objects
2024-02-24 16:41:23 -08:00
Cameron Clough
6ed72b3626 Ford: add hybrid variants to docs (#31575)
* Ford: add hybrid variants to docs

Following up on https://github.com/commaai/openpilot/pull/31568

| CarInfoPlatform              | ElectrificationLevel   | ModelYear              | Series                                                                                            | Trim                                                                |
|:-----------------------------|:-----------------------|:-----------------------|:--------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------|
| FORD BRONCO SPORT 1ST GEN    | ICE                    | 2021, 2022             | BADLANDS, BASE, BIG BEND, FIRST EDITION, OUTER BANKS                                              |                                                                     |
| FORD ESCAPE 4TH GEN          | FHEV                   | 2020, 2021, 2022       | SE, SEL, Titanium                                                                                 |                                                                     |
| FORD ESCAPE 4TH GEN          | ICE                    | 2020, 2021, 2022       | S, SE, SEL, Titanium                                                                              |                                                                     |
| FORD ESCAPE 4TH GEN          | PHEV                   | 2020, 2021, 2022       | SE, SEL, Titanium                                                                                 |                                                                     |
| FORD EXPLORER 6TH GEN        | HEV                    | 2020, 2021, 2022, 2023 | Limited, Platinum                                                                                 |                                                                     |
| FORD EXPLORER 6TH GEN        | ICE                    | 2020, 2021, 2022, 2023 | Base, Black Label, King Ranch, Limited, Platinum, Reserve, ST, ST-Line, Standard, Timberline, XLT |                                                                     |
| FORD EXPLORER 6TH GEN        | PHEV                   | 2020, 2021             | Black Label Grand Touring, Blk Label Grand Touring, Grand Touring                                 |                                                                     |
| FORD F-150 14TH GEN          | HEV                    | 2021, 2022, 2023       | , F-Series                                                                                        | SuperCrew                                                           |
| FORD F-150 14TH GEN          | ICE                    | 2021, 2022, 2023       | , F-Series                                                                                        | , Regular Cab, SuperCab, SuperCrew, SuperCrew-Raptor, SuperCrew-SSV |
| FORD F-150 LIGHTNING 1ST GEN | BEV                    | 2022, 2023             |                                                                                                   | SuperCrew                                                           |
| FORD MAVERICK 1ST GEN        | HEV                    | 2022, 2023             | SUPERCREW, XL XLT Lariat                                                                          | , SUPERCREW                                                         |
| FORD MAVERICK 1ST GEN        | ICE                    | 2022, 2023             | SUPERCREW, XL XLT Lariat, XLT Lariat                                                              | , SUPERCREW                                                         |
| FORD MUSTANG MACH-E 1ST GEN  | BEV                    | 2021, 2022, 2023       | California Route 1, GT, Premium, Select                                                           |                                                                     |

Data from NHTSA database and https://www.ford.co.uk/cars.

* revert F-150 model year change
2024-02-24 10:01:02 -08:00
Shane Smiskol
a2bda8724d Ford: add back OBD queries for logging (#31543)
* Revert "Reapply "Ford: don't fingerprint on engine (#31195)" part 2 (#31320)"

This reverts commit dd6065c33b.

* fix refs

* mark logging
2024-02-22 01:34:15 -08:00
Shane Smiskol
dd6065c33b Reapply "Ford: don't fingerprint on engine (#31195)" part 2 (#31320)
* Reapply "Ford: don't fingerprint on engine (#31195) part 2"

This reverts commit 7694712cd6.

* add comment

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2024-02-05 23:57:46 -08:00
Shane Smiskol
50a552ab8d Reapply "Ford: don't fingerprint on engine (#31195)" (#31303)
* Reapply "Ford: don't fingerprint on engine (#31195)"

This reverts commit 7694712cd6.

* don't change the queries

* revert refs
2024-02-05 14:46:34 -08:00
Shane Smiskol
7694712cd6 Revert "Ford: don't fingerprint on engine (#31195)"
This reverts commit 1d1c9936cf.
2024-02-05 01:35:39 -08:00
Cameron Clough
1d1c9936cf Ford: don't fingerprint on engine (#31195)
* Ford: do not fingerprint engine

* add notebook

* Ford: add missing Explorer FW

* revert

* revert

* Revert "revert"

This reverts commit ad32feaa689f2b497c8bcc9fedc73cae6c87f697.

* TestFwFingerprintTiming: try these

* TestFwFingerprintTiming: update total ref time

* remove notebook

* fix ref

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-01-30 02:42:33 -08:00
Justin Newberry
28eed156e0 Move all fingerprints to fingerprints.py (#30790)
* move fingerpints

* fix circular imports

* fix circular imports

* fix auto fingerprint

* fix those tests

* and controlsd

* add labeler rule

* no defaultdict
2023-12-18 14:04:27 -08:00
Isaac
26a67641d2 Ford: Add Mach-E (#30691)
* Update interface.py

* Update values.py

* Update routes.py

* Update override.yaml

* Update selfdrive/car/ford/values.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update interface.py

* order

* only have dongles for these

42f08a29af3699f4
83a4e056c7072678

from https://github.com/commaai/openpilot/pull/30444

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-12-13 09:05:41 -08:00
Isaac
2192cc170c Ford: Add F-150 Lightning (#30692)
* Update interface.py

* Update values.py

* Update routes.py

* Update override.yaml

* Update values.py

* Update interface.py

* Update selfdrive/car/ford/interface.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-12-12 20:07:59 -08:00
Shane Smiskol
1c011e6024 Ford: add CAN FD harness info (#30698)
* add correct harness to f150 and angled mount

* can remove this
2023-12-12 00:45:13 -08:00
Shane Smiskol
49317e3903 Ford: add Explorer 2020 FW (#30638)
* 49cead668ca2ac46

* docs

* b18d8435f1460528
2023-12-07 16:37:59 -08:00
Shane Smiskol
1cd7b04e6f Ford: add Explorer 2023 FW (#30637)
* 49cead668ca2ac46

* docs
2023-12-07 11:37:18 -08:00
ebo2k
e61ea66415 Ford: add missing engine FW for Bronco Sport 2021 (#30483)
Update values.py

Updated to have correct engine firmware
2023-11-29 14:26:20 -08:00
Keen-coffee
c56c8a719c Add 2022 Maverick engine and abs fingerprint (#30467) 2023-11-28 14:40:04 -08:00
Justin Newberry
6ae465e4af Use StrEnum for car classes (#30114)
* str enum

* import sort

* fix car helpers

* fix that

* fix static analysis
2023-09-30 17:15:34 -07:00
Shane Smiskol
b918e06822 Car docs: update parts docs for 3X (#30076)
* add panda kit

* better: 3X is default

* how about

* replace more three refs
2023-09-28 16:20:03 -07:00
Sean Aguinaga
a30d5d2b7a Ford: add 2023 Maverick Engine FW (#30085)
* Add 2023 Maverick Engine FW

* Pasted wrong line - corrected

* Update selfdrive/car/ford/values.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-28 13:59:05 -07:00
sgtcurry
ed7a0bf0f9 2023 Ford Maverick Ecoboost engine firmware (#29762)
* Update values.py

23 maverick ecoboost engine fw

* Update values.py

* Update values.py

* sorted

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2023-09-04 12:05:57 -07:00
Shane Smiskol
7de9842245 FW Query: test noOBD queries on aux panda (#29547)
* huh, this test just works!

* fix

* Update selfdrive/car/tests/test_fw_fingerprint.py
2023-08-22 23:43:52 -07:00
Adeeb Shihadeh
a9626f95b6 add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
2023-08-20 20:49:55 -07:00
Terry Huang
0c50dd9d0f Ford: Kuga 2022 fingerprint (#29449)
Ford: Kuga 2022 fingerprint
2023-08-18 13:11:50 +01:00
Justin Newberry
106f49a00f Ford: Explorer 2020 fingerprint (#29372) 2023-08-13 16:41:35 -07:00
Cameron Clough
95289cb180 Ford: update Maverick 2022 docs (#29280) 2023-08-08 11:47:23 +01:00
Cameron Clough
e7c858d590 Ford: align car groups with convention
no plural
2023-07-18 11:42:15 +01:00
Shane Smiskol
047bb46d3a Ford: fix CAN FD fingerprinting (#28995)
* fix CAN FD fingerprinting for now

* comment

* this is the simplest for now

* revert

* cmt

* todo and fixme!
2023-07-17 16:56:13 -07:00
Cameron Clough
ed8f17df65 Ford: add back FW query ECU whitelists (#28993)
Partial revert of changes in #28974.
2023-07-17 13:46:47 -07:00