From c0e7dae02fd28f25a16dcf516ed48019f6c09fae Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Mon, 15 Apr 2024 02:00:34 +0100 Subject: [PATCH] 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 old-commit-hash: 7bc81341e10aad9742e113006f702ead75f2fbf2 --- selfdrive/car/ford/fingerprints.py | 14 ++++++++++++++ selfdrive/car/ford/values.py | 4 ++++ selfdrive/car/tests/routes.py | 1 + selfdrive/car/torque_data/override.toml | 1 + 4 files changed, 20 insertions(+) diff --git a/selfdrive/car/ford/fingerprints.py b/selfdrive/car/ford/fingerprints.py index deba38c205..76cbd3aee8 100644 --- a/selfdrive/car/ford/fingerprints.py +++ b/selfdrive/car/ford/fingerprints.py @@ -148,4 +148,18 @@ FW_VERSIONS = { b'NZ6T-14F397-AC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], }, + CAR.FORD_RANGER_MK2: { + (Ecu.eps, 0x730, None): [ + b'NL14-14D003-AE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.abs, 0x760, None): [ + b'PB3C-2D053-ZD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'ML3T-14D049-AL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'PJ6T-14H102-ABJ\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + } } diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index d1e6686ea0..a5494c921c 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -137,6 +137,10 @@ class CAR(Platforms): [FordCarDocs("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0")], CarSpecs(mass=2200, wheelbase=2.984, steerRatio=17.0), # TODO: check steer ratio ) + FORD_RANGER_MK2 = FordCANFDPlatformConfig( + [FordCarDocs("Ford Ranger 2024", "Adaptive Cruise Control with Lane Centering")], + CarSpecs(mass=2000, wheelbase=3.27, steerRatio=17.0), + ) DATA_IDENTIFIER_FORD_ASBUILT = 0xDE00 diff --git a/selfdrive/car/tests/routes.py b/selfdrive/car/tests/routes.py index ae76268d38..35a9d8a8e7 100755 --- a/selfdrive/car/tests/routes.py +++ b/selfdrive/car/tests/routes.py @@ -55,6 +55,7 @@ routes = [ CarTestRoute("bd37e43731e5964b|2023-04-30--10-42-26", FORD.FORD_MAVERICK_MK1), CarTestRoute("112e4d6e0cad05e1|2023-11-14--08-21-43", FORD.FORD_F_150_LIGHTNING_MK1), CarTestRoute("83a4e056c7072678|2023-11-13--16-51-33", FORD.FORD_MUSTANG_MACH_E_MK1), + CarTestRoute("37998aa0fade36ab/00000000--48f927c4f5", FORD.FORD_RANGER_MK2), #TestRoute("f1b4c567731f4a1b|2018-04-30--10-15-35", FORD.FUSION), CarTestRoute("7cc2a8365b4dd8a9|2018-12-02--12-10-44", GM.GMC_ACADIA), diff --git a/selfdrive/car/torque_data/override.toml b/selfdrive/car/torque_data/override.toml index 4d9646a54a..c068bf9a14 100644 --- a/selfdrive/car/torque_data/override.toml +++ b/selfdrive/car/torque_data/override.toml @@ -29,6 +29,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "FORD_MAVERICK_MK1" = [nan, 1.5, nan] "FORD_F_150_LIGHTNING_MK1" = [nan, 1.5, nan] "FORD_MUSTANG_MACH_E_MK1" = [nan, 1.5, nan] +"FORD_RANGER_MK2" = [nan, 1.5, nan] ### # No steering wheel