From 56f69e8435e26a7381433fcd76f23aa963610adc Mon Sep 17 00:00:00 2001 From: Isaac <48419673+coffee-cake-isaac@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:02:44 -0500 Subject: [PATCH 1/8] Adding changes back without spacing (cherry picked from commit 8112017f9290bf02d936dd3869579a662a1fcc27) --- selfdrive/car/ford/interface.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index f5c67dc378..2189301db4 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -20,7 +20,6 @@ class CarInterface(CarInterfaceBase): @staticmethod def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): ret.carName = "ford" - ret.dashcamOnly = candidate in {CAR.F_150_MK14} ret.radarUnavailable = True ret.steerControlType = car.CarParams.SteerControlType.angle @@ -62,6 +61,17 @@ class CarInterface(CarInterfaceBase): ret.steerRatio = 17.0 ret.mass = 2000 + elif candidate == CAR.F_150_LIGHTNING_MK1: + # required trim only on SuperCrew + ret.wheelbase = 3.70 + ret.steerRatio = 16.9 + ret.mass = 2948 + + elif candidate == CAR.MUSTANG_MACH_E_MK1: + ret.wheelbase = 2.984 + ret.steerRatio = 17.0 # guess + ret.mass = 2200 + elif candidate == CAR.FOCUS_MK4: ret.wheelbase = 2.7 ret.steerRatio = 15.0 @@ -154,7 +164,7 @@ class CarInterface(CarInterfaceBase): if not self.CS.vehicle_sensors_valid: events.add(car.CarEvent.EventName.vehicleSensorsInvalid) - if self.CS.hybrid_platform: + if self.CS.hybrid_platform and self.CP.carFingerprint not in CANFD_CAR: events.add(car.CarEvent.EventName.startupNoControl) ret.events = events.to_msg() From 985778c3e3c51a5944c506917a2a72477918fefd Mon Sep 17 00:00:00 2001 From: Isaac <48419673+coffee-cake-isaac@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:29:37 -0500 Subject: [PATCH 2/8] Added changes to add CAN-FD support for Ford --- selfdrive/car/ford/values.py | 61 +++++++++++++++++++++++-- selfdrive/car/tests/routes.py | 4 +- selfdrive/car/torque_data/override.yaml | 2 + 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index cb16d7111f..8b76b4d7d2 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -57,9 +57,11 @@ class CAR(StrEnum): F_150_MK14 = "FORD F-150 14TH GEN" FOCUS_MK4 = "FORD FOCUS 4TH GEN" MAVERICK_MK1 = "FORD MAVERICK 1ST GEN" + F_150_LIGHTNING_MK1 = "FORD F-150 LIGHTNING 1ST GEN" + MUSTANG_MACH_E_MK1 = "FORD MUSTANG MACH-E 1ST GEN" -CANFD_CAR = {CAR.F_150_MK14} +CANFD_CAR = {CAR.F_150_MK14, CAR.F_150_LIGHTNING_MK1, CAR.MUSTANG_MACH_E_MK1} class RADAR: @@ -69,8 +71,10 @@ class RADAR: DBC: Dict[str, Dict[str, str]] = defaultdict(lambda: dbc_dict("ford_lincoln_base_pt", RADAR.DELPHI_MRR)) -# F-150 radar is not yet supported +# CAN-FD radar is not yet supported DBC[CAR.F_150_MK14] = dbc_dict("ford_lincoln_base_pt", None) +DBC[CAR.F_150_LIGHTNING_MK1] = dbc_dict("ford_lincoln_base_pt", None) +DBC[CAR.MUSTANG_MACH_E_MK1] = dbc_dict("ford_lincoln_base_pt", None) class Footnote(Enum): @@ -89,6 +93,10 @@ class FordCarInfo(CarInfo): def init_make(self, CP: car.CarParams): if CP.carFingerprint in (CAR.BRONCO_SPORT_MK1, CAR.MAVERICK_MK1): self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.ford_q3]) + if CP.carFingerprint in (CAR.F_150_LIGHTNING_MK1, CAR.F_150_MK14, CAR.MUSTANG_MACH_E_MK1): + self.car_parts = CarParts([CarHarness.ford_q4]) + if CP.carFingerprint in (CAR.F_150_LIGHTNING_MK1, CAR.F_150_MK14): + self.car_parts = CarParts([Device.threex_angled_mount]) CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { @@ -101,7 +109,9 @@ CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { FordCarInfo("Ford Explorer 2020-22"), FordCarInfo("Lincoln Aviator 2020-21", "Co-Pilot360 Plus"), ], - CAR.F_150_MK14: FordCarInfo("Ford F-150 2023", "Co-Pilot360 Active 2.0"), + CAR.F_150_MK14: FordCarInfo("Ford F-150 2022-23", "Co-Pilot360 Active 2.0"), + CAR.F_150_LIGHTNING_MK1: FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0"), + CAR.MUSTANG_MACH_E_MK1: FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0"), CAR.FOCUS_MK4: FordCarInfo("Ford Focus 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]), CAR.MAVERICK_MK1: [ FordCarInfo("Ford Maverick 2022", "LARIAT Luxury"), @@ -229,6 +239,7 @@ FW_VERSIONS = { ], (Ecu.abs, 0x760, None): [ b'PL34-2D053-CA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'NL34-2D053-CA\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', @@ -238,6 +249,50 @@ FW_VERSIONS = { ], (Ecu.engine, 0x7E0, None): [ b'PL3A-14C204-BRB\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PL3A-14C204-BTB\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'ML3A-14C204-VHD\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + CAR.F_150_LIGHTNING_MK1: { + (Ecu.abs, 0x760, None): [ + b'PL38-2D053-AA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'ML3T-14H102-ABT\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.engine, 0x7E0, None): [ + b'NL3A-14C204-BAR\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, + CAR.MUSTANG_MACH_E_MK1: { + (Ecu.eps, 0x730, None): [ + b'LJ9C-14D003-AK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'LJ9C-14D003-AM\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'LJ9C-14D003-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'LJ9C-14D003-EA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.abs, 0x760, None): [ + b'LK9C-2D053-CC\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'LK9C-2D053-CD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'LK9C-2D053-CK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x764, None): [ + b'ML3T-14D049-AK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'ML3T-14D049-AL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x706, None): [ + b'ML3T-14H102-ABS\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'ML3T-14H102-ABP\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PJ6T-14H102-ABK\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7E0, None): [ + b'MJ98-14C204-BBP\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'MJ98-14C204-AXD\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'NJ98-14C204-VE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'PJ98-14C204-BE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], }, CAR.FOCUS_MK4: { diff --git a/selfdrive/car/tests/routes.py b/selfdrive/car/tests/routes.py index 8cf5f3debd..2b30f03aa4 100755 --- a/selfdrive/car/tests/routes.py +++ b/selfdrive/car/tests/routes.py @@ -16,7 +16,6 @@ from openpilot.selfdrive.car.body.values import CAR as COMMA # TODO: add routes for these cars non_tested_cars = [ - FORD.F_150_MK14, GM.CADILLAC_ATS, GM.HOLDEN_ASTRA, GM.MALIBU, @@ -53,6 +52,9 @@ routes = [ CarTestRoute("62241b0c7fea4589|2022-09-01--15-32-49", FORD.EXPLORER_MK6), CarTestRoute("e886087f430e7fe7|2023-06-16--23-06-36", FORD.FOCUS_MK4), CarTestRoute("bd37e43731e5964b|2023-04-30--10-42-26", FORD.MAVERICK_MK1), + CarTestRoute("112e4d6e0cad05e1|2023-11-14--08-21-43", FORD.F_150_LIGHTNING_MK1), + CarTestRoute("24574459dd7fb3e0|2023-11-06--06-23-44", FORD.F_150_MK14), + CarTestRoute("83a4e056c7072678|2023-11-13--16-51-33", FORD.MUSTANG_MACH_E_MK1), #TestRoute("f1b4c567731f4a1b|2018-04-30--10-15-35", FORD.FUSION), CarTestRoute("7cc2a8365b4dd8a9|2018-12-02--12-10-44", GM.ACADIA), diff --git a/selfdrive/car/torque_data/override.yaml b/selfdrive/car/torque_data/override.yaml index 61f8dc2b3c..e6f637e794 100644 --- a/selfdrive/car/torque_data/override.yaml +++ b/selfdrive/car/torque_data/override.yaml @@ -26,6 +26,8 @@ FORD EXPLORER 6TH GEN: [.nan, 1.5, .nan] FORD F-150 14TH GEN: [.nan, 1.5, .nan] FORD FOCUS 4TH GEN: [.nan, 1.5, .nan] FORD MAVERICK 1ST GEN: [.nan, 1.5, .nan] +FORD F-150 LIGHTNING 1ST GEN: [.nan, 1.5, .nan] +FORD MUSTANG MACH-E 1ST GEN: [.nan, 1.5, .nan] ### # No steering wheel From 2b0bec9e651c2229e35d80a760dec6e871077d30 Mon Sep 17 00:00:00 2001 From: Isaac Barham Date: Tue, 5 Dec 2023 20:10:18 +0000 Subject: [PATCH 3/8] Updated to include deadzone for stopping --- selfdrive/car/ford/interface.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 2189301db4..60c9a3a0b6 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -84,6 +84,12 @@ class CarInterface(CarInterfaceBase): else: raise ValueError(f"Unsupported car: {candidate}") + + ret.longitudinalTuning.kpBP = [0.] + ret.longitudinalTuning.kpV = [0.5] + ret.longitudinalTuning.kiV = [0.] + ret.longitudinalTuning.deadzoneBP = [0., 9.] + ret.longitudinalTuning.deadzoneV = [.0, .20] # Auto Transmission: 0x732 ECU or Gear_Shift_by_Wire_FD1 found_ecus = [fw.ecu for fw in car_fw] From bb940d1a78d3219562607e5c67c99ee24cf792df Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 7 Dec 2023 11:43:19 -0500 Subject: [PATCH 4/8] Update FCR and CHANGELOGS.md --- CHANGELOGS.md | 3 +++ selfdrive/car/sunnypilot_carname.json | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 483cf496ee..51a9786f96 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -17,6 +17,9 @@ sunnypilot - 0.9.5.2 (2023-12-07) * Hybrid 2022-23 * Plug-in Hybrid 2022-23 * NEW❗: Lane Change: When manually braking with steering engaged, turning on the turn signal will default to Nudge mode +* Ford F-150 2022-23 support +* Ford F-150 Lightning 2021-23 support +* Ford Mustang Mach-E 2021-23 support * Volkswagen MQB CC only platforms (radar or no radar) support thanks to jyoung8607! sunnypilot - 0.9.5.1 (2023-11-17) diff --git a/selfdrive/car/sunnypilot_carname.json b/selfdrive/car/sunnypilot_carname.json index 444e40515a..85bb432c0b 100644 --- a/selfdrive/car/sunnypilot_carname.json +++ b/selfdrive/car/sunnypilot_carname.json @@ -26,10 +26,13 @@ "Ford Bronco Sport 2021-22": "FORD BRONCO SPORT 1ST GEN", "Ford Escape 2020-22": "FORD ESCAPE 4TH GEN", "Ford Explorer 2020-22": "FORD EXPLORER 6TH GEN", + "Ford F-150 2022-23": "FORD F-150 14TH GEN", + "Ford F-150 Lightning 2021-23": "FORD F-150 LIGHTNING 1ST GEN", "Ford Focus 2018": "FORD FOCUS 4TH GEN", "Ford Kuga 2020-22": "FORD ESCAPE 4TH GEN", "Ford Maverick 2022": "FORD MAVERICK 1ST GEN", "Ford Maverick 2023": "FORD MAVERICK 1ST GEN", + "Ford Mustang Mach-E 2021-23": "FORD MUSTANG MACH-E 1ST GEN", "Genesis G70 2018-19": "GENESIS G70 2018", "Genesis G70 2020": "GENESIS G70 2020", "Genesis G70 Non-SCC 2021": "GENESIS G70 2021 NON-SCC", @@ -202,7 +205,6 @@ "Škoda Octavia RS 2016": "SKODA OCTAVIA 3RD GEN", "Škoda Scala 2020-23": "SKODA SCALA 1ST GEN", "Škoda Superb 2015-22": "SKODA SUPERB 3RD GEN", - "Škoda Superb 2015-22 CC Only": "SKODA SUPERB 3RD GEN CC ONLY", "Toyota Alphard 2019-20": "TOYOTA ALPHARD 2020", "Toyota Alphard Hybrid 2021": "TOYOTA ALPHARD 2020", "Toyota Avalon 2016": "TOYOTA AVALON 2016", From 71de09824c27022c83db14aba6ab0f92f0849c72 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 7 Dec 2023 11:44:08 -0500 Subject: [PATCH 5/8] bump panda --- panda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda b/panda index 467e0e2ca0..46141c8bed 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 467e0e2ca06ee746103e6de6f26ab18b01f928e3 +Subproject commit 46141c8bed55f8dd9b604980b299bf8e30c5a1a6 From 3196ade663a08d7c8223c1207f3769f352943cb2 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 7 Dec 2023 17:33:11 -0500 Subject: [PATCH 6/8] oops by issac ;) --- panda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda b/panda index 46141c8bed..30c47d0066 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 46141c8bed55f8dd9b604980b299bf8e30c5a1a6 +Subproject commit 30c47d00669cf5c0d02b2aa9edcb844208ec80d1 From d852e4a4f0c37eca2138b20e17efdf55f65b37e6 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 16 May 2024 02:00:38 -0400 Subject: [PATCH 7/8] FCR: sync with upstream supported car platforms --- selfdrive/car/sunnypilot_carname.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selfdrive/car/sunnypilot_carname.json b/selfdrive/car/sunnypilot_carname.json index b42d6702e4..14bd5df389 100644 --- a/selfdrive/car/sunnypilot_carname.json +++ b/selfdrive/car/sunnypilot_carname.json @@ -28,6 +28,9 @@ "Ford Escape Plug-in Hybrid 2020-22": "FORD_ESCAPE_MK4", "Ford Explorer 2020-23": "FORD_EXPLORER_MK6", "Ford Explorer Hybrid 2020-23": "FORD_EXPLORER_MK6", + "Ford F-150 2022-23": "FORD_F_150_MK14", + "Ford F-150 Hybrid 2022-23": "FORD_F_150_MK14", + "Ford F-150 Lightning 2021-23": "FORD_F_150_LIGHTNING_MK1", "Ford Focus 2018": "FORD_FOCUS_MK4", "Ford Focus Hybrid 2018": "FORD_FOCUS_MK4", "Ford Kuga 2020-22": "FORD_ESCAPE_MK4", @@ -37,6 +40,8 @@ "Ford Maverick 2023-24": "FORD_MAVERICK_MK1", "Ford Maverick Hybrid 2022": "FORD_MAVERICK_MK1", "Ford Maverick Hybrid 2023-24": "FORD_MAVERICK_MK1", + "Ford Mustang Mach-E 2021-23": "FORD_MUSTANG_MACH_E_MK1", + "Ford Ranger 2024": "FORD_RANGER_MK2", "Genesis G70 2018": "GENESIS_G70", "Genesis G70 2019-21": "GENESIS_G70_2020", "Genesis G70 2022-23": "GENESIS_G70_2020", From 2833cf9d48d812cc0ad662c6565fcdf970e91b12 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 16 May 2024 02:01:34 -0400 Subject: [PATCH 8/8] Update CHANGELOGS.md --- CHANGELOGS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 8569e02674..a25d3e0ce5 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -45,6 +45,9 @@ sunnypilot - 0.9.7.0 (2024-05-xx) * Display Metrics Below Chevron * NEW❗: Metrics is now being displayed below the chevron instead of above * NEW❗: Display both Distance and Speed simultaneously +* Ford F-150 2022-23 support +* Ford F-150 Lightning 2021-23 support +* Ford Mustang Mach-E 2021-23 support sunnypilot - 0.9.6.1 (2024-02-27) ======================== @@ -167,9 +170,6 @@ sunnypilot - 0.9.5.2 (2023-12-07) * Hybrid 2022-23 * Plug-in Hybrid 2022-23 * NEW❗: Lane Change: When manually braking with steering engaged, turning on the turn signal will default to Nudge mode -* Ford F-150 2022-23 support -* Ford F-150 Lightning 2021-23 support -* Ford Mustang Mach-E 2021-23 support * Volkswagen MQB CC only platforms (radar or no radar) support thanks to jyoung8607! sunnypilot - 0.9.5.1 (2023-11-17)