From d5b4ba8239cb71d62c1bed6cf4d17fc5cfa3ca14 Mon Sep 17 00:00:00 2001 From: Isaac <48419673+coffee-cake-isaac@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:05:41 -0500 Subject: [PATCH] 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 * Update interface.py * order * only have dongles for these 42f08a29af3699f4 83a4e056c7072678 from https://github.com/commaai/openpilot/pull/30444 --------- Co-authored-by: Adeeb Shihadeh Co-authored-by: Shane Smiskol old-commit-hash: 26a67641d2e4a4b908239996c7a9b580c3813d4b --- selfdrive/car/ford/interface.py | 5 +++++ selfdrive/car/ford/values.py | 26 +++++++++++++++++++++++-- selfdrive/car/tests/routes.py | 1 + selfdrive/car/torque_data/override.yaml | 1 + 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 993b4a511c..8a8ce36bd0 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -62,6 +62,11 @@ class CarInterface(CarInterfaceBase): 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 diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index 98f94f26f6..4b05d474f7 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -48,9 +48,10 @@ class CAR(StrEnum): 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, CAR.F_150_LIGHTNING_MK1} +CANFD_CAR = {CAR.F_150_MK14, CAR.F_150_LIGHTNING_MK1, CAR.MUSTANG_MACH_E_MK1} class RADAR: @@ -63,6 +64,7 @@ DBC: Dict[str, Dict[str, str]] = defaultdict(lambda: dbc_dict("ford_lincoln_base # F-150 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): @@ -97,6 +99,7 @@ CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { ], CAR.F_150_MK14: FordCarInfo("Ford F-150 2023", "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"), @@ -240,7 +243,7 @@ FW_VERSIONS = { b'PL3A-14C204-BRB\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], }, - CAR.F_150_LIGHTNING_MK1: { + CAR.F_150_LIGHTNING_MK1: { (Ecu.abs, 0x760, None): [ b'PL38-2D053-AA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], @@ -254,6 +257,25 @@ FW_VERSIONS = { 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-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', + ], + (Ecu.abs, 0x760, None): [ + b'LK9C-2D053-CK\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'ML3T-14H102-ABS\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + (Ecu.engine, 0x7E0, None): [ + b'NJ98-14C204-VH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', + b'MJ98-14C204-BBS\x00\x00\x00\x00\x00\x00\x00\x00\x00', + ], + }, CAR.FOCUS_MK4: { (Ecu.eps, 0x730, None): [ b'JX6C-14D003-AH\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', diff --git a/selfdrive/car/tests/routes.py b/selfdrive/car/tests/routes.py index 96d589d1a8..8de688e8ff 100755 --- a/selfdrive/car/tests/routes.py +++ b/selfdrive/car/tests/routes.py @@ -53,6 +53,7 @@ routes = [ 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("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 0272b02d2d..60e54af210 100644 --- a/selfdrive/car/torque_data/override.yaml +++ b/selfdrive/car/torque_data/override.yaml @@ -27,6 +27,7 @@ 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