From 3e5091d9ec3134d70ca6ba62ba1859d5129c1aab Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 04:48:36 -0500 Subject: [PATCH 01/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index b70a9a394b..5cc96128eb 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -5,7 +5,7 @@ from opendbc.can.parser import CANParser from opendbc.car import Bus, create_button_events, structs from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion +from opendbc.car.honda.hondacan import CanBus from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \ HondaFlags, CruiseButtons, CruiseSettings, GearShifter @@ -70,7 +70,7 @@ def get_can_messages(CP, gearbox_msg): # TODO: clean this up if CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): + CAR.ACURA_RDX_3G, CAR.HONDA_ODYSSEY_5G_MMR, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): pass elif CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): pass @@ -107,6 +107,7 @@ def __init__(self, CP): self.brake_switch_active = False self.cruise_setting = 0 self.v_cruise_pcm_prev = 0 + self.is_metric_cruise = False # When available we use cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] to populate vEgoCluster # However, on cars without a digital speedometer this is not always present (HRV, FIT, CRV 2016, ILX and RDX) @@ -133,13 +134,21 @@ def update(self, can_parsers) -> structs.CarState: # used for car hud message self.is_metric = not cp.vl["CAR_SPEED"]["IMPERIAL_UNIT"] + # is_metric_cruise is used for cruise speed display + # ACC_HUD is on camera bus on radarless cars + acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] + if acc_hud["CRUISE_SPEED"] >= 253: + self.is_metric_cruise = self.is_metric + else: + self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] + # ******************* parse out can ******************* # STANDSTILL->WHEELS_MOVING bit can be noisy around zero, so use XMISSION_SPEED # panda checks if the signal is non-zero ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5 # TODO: find a common signal across all cars if self.CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT, - CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): + CAR.ACURA_RDX_3G, CAR.HONDA_ODYSSEY_5G_MMR, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G): ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"]) elif self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_CHN, CAR.HONDA_FREED, CAR.HONDA_HRV): ret.doorOpen = bool(cp.vl["SCM_BUTTONS"]["DRIVERS_DOOR_OPEN"]) @@ -225,7 +234,7 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. - conversion = get_cruise_speed_conversion(self.CP.carFingerprint, self.is_metric) + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed @@ -251,6 +260,9 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.enabled = cp.vl["POWERTRAIN_DATA"]["ACC_STATUS"] != 0 ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) + # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): if ret.brake > 0.1: From a4f0fc5c8c3410463a80361c16f6347183ee0882 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 04:52:20 -0500 Subject: [PATCH 02/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 43e227df5a..2a1b9b27f9 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -119,7 +119,7 @@ def __init__(self, dbc_names, CP): def update(self, CC, CS, now_nanos): actuators = CC.actuators hud_control = CC.hudControl - conversion = hondacan.get_cruise_speed_conversion(self.CP.carFingerprint, CS.is_metric) + conversion = CV.KPH_TO_MS if CS.is_metric_cruise else CV.MPH_TO_MS hud_v_cruise = hud_control.setSpeed / conversion if hud_control.speedVisible else 255 pcm_cancel_cmd = CC.cruiseControl.cancel @@ -206,7 +206,11 @@ def update(self, CC, CS, now_nanos): ts = self.frame * DT_CTRL if self.CP.carFingerprint in HONDA_BOSCH: - self.accel = float(np.clip(accel, self.params.BOSCH_ACCEL_MIN, self.params.BOSCH_ACCEL_MAX)) + if self.CP.carFingerprint in HONDA_BOSCH_1000: + self.accel = float(np.clip(accel, self.params.BOSCH_1000_ACCEL_MIN, self.params.BOSCH_1000_ACCEL_MAX)) + else: + self.accel = float(np.clip(accel, self.params.BOSCH_ACCEL_MIN, self.params.BOSCH_ACCEL_MAX)) + self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) stopping = actuators.longControlState == LongCtrlState.stopping From 67536c6b54590a7a799c70c0769e10ce5e7b7ddd Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 04:55:16 -0500 Subject: [PATCH 03/54] Odyssey_5G_MMR --- opendbc/car/honda/fingerprints.py | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/opendbc/car/honda/fingerprints.py b/opendbc/car/honda/fingerprints.py index 486f5005a4..0eed4e73fd 100644 --- a/opendbc/car/honda/fingerprints.py +++ b/opendbc/car/honda/fingerprints.py @@ -562,6 +562,46 @@ b'77959-T6A-P110\x00\x00', ], }, + CAR.HONDA_ODYSSEY_5G_MMR: { + (Ecu.vsa, 0x18da28f1, None): [ + b'57114-THR-A230\x00\x00', + b'57114-THR-A240\x00\x00', + b'57114-THR-A520\x00\x00', + ], + (Ecu.fwdRadar, 0x18dab0f1, None): [ + b'36802-THR-A220\x00\x00', + ], + (Ecu.fwdCamera, 0x18dab5f1, None): [ + b'36161-THR-A220\x00\x00', + b'36161-THR-A230\x00\x00', + ], + (Ecu.shiftByWire, 0x18da0bf1, None): [ + b'54008-THR-A310\x00\x00', + b'54008-THR-A310\x00\x00', + ], + (Ecu.transmission, 0x18da1ef1, None): [ + b'28102-5MX-A410\x00\x00', + ], + (Ecu.srs, 0x18da53f1, None): [ + b'77959-THR-A220\x00\x00', + b'77959-THR-A230\x00\x00', + b'77959-THR-A320\x00\x00', + ], + (Ecu.electricBrakeBooster, 0x18da2bf1, None): [ + b'46114-THR-A530\x00\x00', + b'46114-THR-A540\x00\x00', + b'46114-THR-A720\x00\x00', + ], + (Ecu.gateway, 0x18daeff1, None): [ + b'38897-THR-A130\x00\x00', + b'38897-THR-A320\x00\x00', + b'38897-THR-A410\x00\x00', + ], + (Ecu.eps, 0x18da30f1, None): [ + b'39990-THR-A050\x00\x00', + b'39990-THR-A110\x00\x00', + ], + }, CAR.HONDA_PILOT: { (Ecu.shiftByWire, 0x18da0bf1, None): [ b'54008-TG7-A520\x00\x00', From f2305efec03171bdb2a7e3780b89df7ea96e9671 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 04:56:25 -0500 Subject: [PATCH 04/54] Odyssey_5G_MMR --- opendbc/car/honda/hondacan.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/opendbc/car/honda/hondacan.py b/opendbc/car/honda/hondacan.py index 878bdcb62b..b314e568f9 100644 --- a/opendbc/car/honda/hondacan.py +++ b/opendbc/car/honda/hondacan.py @@ -44,11 +44,6 @@ def body(self) -> int: return self.offset -def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float: - # on certain cars, CRUISE_SPEED changes to imperial with car's unit setting - return CV.MPH_TO_MS if car_fingerprint in HONDA_BOSCH_RADARLESS and not is_metric else CV.KPH_TO_MS - - def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): # TODO: do we loose pressure if we keep pump off for long? brakelights = apply_brake > 0 From c3649d1c8baac56ea7034de5def0b0d6901a5109 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 04:59:38 -0500 Subject: [PATCH 05/54] Odyssey_5G_MMR --- opendbc/car/honda/interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index 5d3830ee75..168c0c4517 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -163,6 +163,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime else: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + elif candidate == CAR.HONDA_ODYSSEY_5G_MMR: + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]] + elif candidate == CAR.HONDA_PILOT: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] @@ -206,7 +210,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.autoResumeSng = candidate in (HONDA_BOSCH | {CAR.HONDA_CIVIC}) ret.minEnableSpeed = -1. if ret.autoResumeSng else 25.51 * CV.MPH_TO_MS - ret.steerActuatorDelay = 0.1 + ret.steerActuatorDelay = 0.3 if candidate in (CAR.HONDA_ODYSSEY_5G_MMR) else 0.1 ret.steerLimitTimer = 0.8 ret.radarDelay = 0.1 From ea4df30c3e942b0ad685030d1af0bb520343df08 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:05:30 -0500 Subject: [PATCH 06/54] Odyssey_5G_MMR --- opendbc/car/honda/values.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 9233f75067..af4b5c1915 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -33,6 +33,7 @@ class CarControllerParams: BOSCH_GAS_LOOKUP_BP = [-0.2, 2.0] # 2m/s^2 BOSCH_GAS_LOOKUP_V = [0, 1600] + BOSCH_1000_GAS_LOOKUP_V = [0, 2000] STEER_STEP = 1 # 100 Hz STEER_DELTA_UP = 3 # min/max in 0.33s for all Honda @@ -180,6 +181,12 @@ class CAR(Platforms): {Bus.pt: 'honda_civic_ex_2022_can_generated'}, flags=HondaFlags.BOSCH_RADARLESS, ) + HONDA_ODYSSEY_5G_MMR = HondaBoschPlatformConfig( + [HondaCarDocs("Honda Odyssey 2021-2025", "All", min_steer_speed=3. * CV.MPH_TO_MS)], + CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=13.35, centerToFrontRatio=0.54, tireStiffnessFactor=1.02), # as spec + {Bus.pt: 'acura_rdx_2020_can_generated'}, + flags=HondaFlags.BOSCH_ALT_BRAKE, + ) ACURA_RDX_3G = HondaBoschPlatformConfig( [HondaCarDocs("Acura RDX 2019-21", "All", min_steer_speed=3. * CV.MPH_TO_MS)], CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41, tireStiffnessFactor=0.677), # as spec @@ -314,9 +321,9 @@ class CAR(Platforms): # Note that we still attempt to match with them when they are present # This is or'd with (ALL_ECUS - ESSENTIAL_ECUS) from fw_versions.py non_essential_ecus={ - Ecu.eps: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_2022, CAR.HONDA_E, CAR.HONDA_HRV_3G], + Ecu.eps: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_2022, CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_ODYSSEY_5G_MMR], Ecu.vsa: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_2022, CAR.HONDA_CRV_5G, CAR.HONDA_CRV_HYBRID, - CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT], + CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT, CAR.HONDA_ODYSSEY_5G_MMR], }, extra_ecus=[ (Ecu.combinationMeter, 0x18da60f1, None), From 151ca418ceefd00e26a8ebe3ddf0f145838e31a9 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:08:19 -0500 Subject: [PATCH 07/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 2a1b9b27f9..ac2d3fe21c 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -206,13 +206,12 @@ def update(self, CC, CS, now_nanos): ts = self.frame * DT_CTRL if self.CP.carFingerprint in HONDA_BOSCH: + self.accel = float(np.clip(accel, self.params.BOSCH_ACCEL_MIN, self.params.BOSCH_ACCEL_MAX)) if self.CP.carFingerprint in HONDA_BOSCH_1000: - self.accel = float(np.clip(accel, self.params.BOSCH_1000_ACCEL_MIN, self.params.BOSCH_1000_ACCEL_MAX)) + self.gas = float(np.interp(accel, self.params.BOSCH_1000_GAS_LOOKUP_BP, self.params.BOSCH_1000_GAS_LOOKUP_V)) else: - self.accel = float(np.clip(accel, self.params.BOSCH_ACCEL_MIN, self.params.BOSCH_ACCEL_MAX)) + self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) - self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) - stopping = actuators.longControlState == LongCtrlState.stopping self.stopping_counter = self.stopping_counter + 1 if stopping else 0 can_sends.extend(hondacan.create_acc_commands(self.packer, self.CAN, CC.enabled, CC.longActive, self.accel, self.gas, From cbc1e03fb305d18127e72c28062b21119d81d72e Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:10:17 -0500 Subject: [PATCH 08/54] Odyssey_5G_MMR --- opendbc/car/honda/values.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index af4b5c1915..d0834b6868 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -346,6 +346,7 @@ class CAR(Platforms): HONDA_NIDEC_ALT_SCM_MESSAGES = CAR.with_flags(HondaFlags.NIDEC_ALT_SCM_MESSAGES) HONDA_BOSCH = CAR.with_flags(HondaFlags.BOSCH) HONDA_BOSCH_RADARLESS = CAR.with_flags(HondaFlags.BOSCH_RADARLESS) +HONDA_BOSCH_1000 = {CAR.HONDA_ODYSSEY_5G_MMR} # overrides for 1000 gas units per m/s accel DBC = CAR.create_dbc_map() From e2a41e8e52a8c8b1f438b097239d1ffa157d96c4 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:12:30 -0500 Subject: [PATCH 09/54] Odyssey_5G_MMR --- docs/CARS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CARS.md b/docs/CARS.md index d264c5ea95..dc72493394 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -87,7 +87,7 @@ |Honda|Insight 2019-22|All|[Upstream](#upstream)| |Honda|Inspire 2018|All|[Upstream](#upstream)| |Honda|Odyssey 2018-20|Honda Sensing|[Upstream](#upstream)| -|Honda|Odyssey 2021-25|All|[Community](#community)| +|Honda|Odyssey 2021-25|All|[Upstream](#upstream)| |Honda|Passport 2019-23|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| |Honda|Pilot 2023-24|All|[Community](#community)| @@ -421,4 +421,4 @@ Toyota, and the GM Global B platform. All the cars that openpilot supports use a [CAN bus](https://en.wikipedia.org/wiki/CAN_bus) for communication between all the car's computers, however a CAN bus isn't the only way that the computers in your car can communicate. Most, if not all, vehicles from the following manufacturers use [FlexRay](https://en.wikipedia.org/wiki/FlexRay) instead of a CAN bus: **BMW, Mercedes, Audi, Land Rover, and some Volvo**. These cars -may one day be supported, but we have no immediate plans to support FlexRay. \ No newline at end of file +may one day be supported, but we have no immediate plans to support FlexRay. From 83f8210e6db7f66e6b1d1429b9f3b7ade9762db7 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:20:56 -0500 Subject: [PATCH 10/54] Odyssey_5G_MMR --- opendbc/car/honda/interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index 168c0c4517..06adacb1e4 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -164,7 +164,11 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end elif candidate == CAR.HONDA_ODYSSEY_5G_MMR: - ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end + if not ret.openpilotLongitudinalControl: + ret.minSteerSpeed = 70.0 * CV.KPH_TO_MS + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # clipped by radar + else: + ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]] elif candidate == CAR.HONDA_PILOT: From 533ce5862f97fb3e9d42086b5ac75170051b8b87 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 05:50:25 -0500 Subject: [PATCH 11/54] Odyssey_5G_MMR --- opendbc/car/torque_data/params.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/torque_data/params.toml b/opendbc/car/torque_data/params.toml index 4bb8d45c53..e0190aa658 100644 --- a/opendbc/car/torque_data/params.toml +++ b/opendbc/car/torque_data/params.toml @@ -20,6 +20,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HONDA_HRV" = [2.0661212805710205, 0.7521343418694775, 0.17760375789242094] "HONDA_INSIGHT" = [1.5201671214069354, 0.5660229120683284, 0.25808042580281876] "HONDA_ODYSSEY" = [1.8774809275211801, 0.8394431662987996, 0.2096978613792822] +"HONDA_ODYSSEY_5G_MMR" = [1.6, 0.8394431662987996, 0.226] "HONDA_PILOT" = [1.7262026201812795, 0.9470005614967523, 0.21351430733218763] "HONDA_RIDGELINE" = [1.4146525028237624, 0.7356572861629564, 0.23307177552211328] "HYUNDAI_ELANTRA_2021" = [3.169, 2.1259108157250735, 0.0819] From 7cad756bc8adeaeae5e7fbe410bcbab1c1a51081 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 08:11:22 -0500 Subject: [PATCH 12/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index ac2d3fe21c..87c2be968a 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -4,7 +4,7 @@ from opendbc.can.packer import CANPacker from opendbc.car import Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs from opendbc.car.honda import hondacan -from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams +from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, HONDA_BOSCH_1000, CarControllerParams from opendbc.car.interfaces import CarControllerBase VisualAlert = structs.CarControl.HUDControl.VisualAlert From 3c450732a425d12f0a4260e2a5d738a5e98eb814 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Wed, 5 Mar 2025 18:08:28 -0500 Subject: [PATCH 13/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 5cc96128eb..fe2671f9c9 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -261,7 +261,7 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph - ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + ret.low_speed_alert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From af361684d7c8472449dfd711de4a5a437f62fe57 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:20:41 -0500 Subject: [PATCH 14/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 87c2be968a..6db07ea8a1 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -4,7 +4,8 @@ from opendbc.can.packer import CANPacker from opendbc.car import Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs from opendbc.car.honda import hondacan -from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, HONDA_BOSCH_1000, CarControllerParams +from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, HONDA_BOSCH_1000, \ + CarControllerParams from opendbc.car.interfaces import CarControllerBase VisualAlert = structs.CarControl.HUDControl.VisualAlert From daf1be0b730cb9dfe581a6a25327eb16cae5706a Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:23:27 -0500 Subject: [PATCH 15/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 6db07ea8a1..31e6e994dc 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -4,6 +4,7 @@ from opendbc.can.packer import CANPacker from opendbc.car import Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs from opendbc.car.honda import hondacan +from opendbc.car.common.conversions import Conversions as CV from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, HONDA_BOSCH_1000, \ CarControllerParams from opendbc.car.interfaces import CarControllerBase @@ -212,7 +213,6 @@ def update(self, CC, CS, now_nanos): self.gas = float(np.interp(accel, self.params.BOSCH_1000_GAS_LOOKUP_BP, self.params.BOSCH_1000_GAS_LOOKUP_V)) else: self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) - stopping = actuators.longControlState == LongCtrlState.stopping self.stopping_counter = self.stopping_counter + 1 if stopping else 0 can_sends.extend(hondacan.create_acc_commands(self.packer, self.CAN, CC.enabled, CC.longActive, self.accel, self.gas, From 050292d9b75f422a24b65098cb86d2d38596200e Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:45:47 -0500 Subject: [PATCH 16/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index fe2671f9c9..0a2dd7c48a 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -141,7 +141,7 @@ def update(self, can_parsers) -> structs.CarState: self.is_metric_cruise = self.is_metric else: self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] - + # ******************* parse out can ******************* # STANDSTILL->WHEELS_MOVING bit can be noisy around zero, so use XMISSION_SPEED # panda checks if the signal is non-zero @@ -234,7 +234,7 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed @@ -261,8 +261,8 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph - ret.low_speed_alert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 - + ret.low_speed_alert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): if ret.brake > 0.1: From 08976cb042a4a27e6c05d9b58b58b4f7c78c3bd7 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:47:29 -0500 Subject: [PATCH 17/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 31e6e994dc..df822f5efc 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -213,6 +213,7 @@ def update(self, CC, CS, now_nanos): self.gas = float(np.interp(accel, self.params.BOSCH_1000_GAS_LOOKUP_BP, self.params.BOSCH_1000_GAS_LOOKUP_V)) else: self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) + stopping = actuators.longControlState == LongCtrlState.stopping self.stopping_counter = self.stopping_counter + 1 if stopping else 0 can_sends.extend(hondacan.create_acc_commands(self.packer, self.CAN, CC.enabled, CC.longActive, self.accel, self.gas, From 41f033b6e73262d8b204e2964fa5e55670849066 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:48:38 -0500 Subject: [PATCH 18/54] Odyssey_5G_MMR --- opendbc/car/honda/fingerprints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/fingerprints.py b/opendbc/car/honda/fingerprints.py index 0eed4e73fd..cbcf044104 100644 --- a/opendbc/car/honda/fingerprints.py +++ b/opendbc/car/honda/fingerprints.py @@ -580,7 +580,7 @@ b'54008-THR-A310\x00\x00', ], (Ecu.transmission, 0x18da1ef1, None): [ - b'28102-5MX-A410\x00\x00', + b'28102-5MX-A410\x00\x00', ], (Ecu.srs, 0x18da53f1, None): [ b'77959-THR-A220\x00\x00', From 2ef9394fd5134581a8c42b80eac34e009b8b874a Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 18:49:17 -0500 Subject: [PATCH 19/54] Odyssey_5G_MMR --- opendbc/car/honda/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index d0834b6868..af67e471cf 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -323,7 +323,7 @@ class CAR(Platforms): non_essential_ecus={ Ecu.eps: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_2022, CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_ODYSSEY_5G_MMR], Ecu.vsa: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_2022, CAR.HONDA_CRV_5G, CAR.HONDA_CRV_HYBRID, - CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT, CAR.HONDA_ODYSSEY_5G_MMR], + CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT, CAR.HONDA_ODYSSEY_5G_MMR], }, extra_ecus=[ (Ecu.combinationMeter, 0x18da60f1, None), From 8f4fd447ed5634fb9f9f983bbd2366a4ccc75e4b Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 19:05:02 -0500 Subject: [PATCH 20/54] Odyssey_5G_MMR --- opendbc/car/honda/fingerprints.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/honda/fingerprints.py b/opendbc/car/honda/fingerprints.py index cbcf044104..f268c2057b 100644 --- a/opendbc/car/honda/fingerprints.py +++ b/opendbc/car/honda/fingerprints.py @@ -577,7 +577,6 @@ ], (Ecu.shiftByWire, 0x18da0bf1, None): [ b'54008-THR-A310\x00\x00', - b'54008-THR-A310\x00\x00', ], (Ecu.transmission, 0x18da1ef1, None): [ b'28102-5MX-A410\x00\x00', From cf286491b0367d7c8a65d1ea09cefa7e28e9004b Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 19:57:17 -0500 Subject: [PATCH 21/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 0a2dd7c48a..fc6e1ad3b8 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -134,14 +134,6 @@ def update(self, can_parsers) -> structs.CarState: # used for car hud message self.is_metric = not cp.vl["CAR_SPEED"]["IMPERIAL_UNIT"] - # is_metric_cruise is used for cruise speed display - # ACC_HUD is on camera bus on radarless cars - acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] - if acc_hud["CRUISE_SPEED"] >= 253: - self.is_metric_cruise = self.is_metric - else: - self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] - # ******************* parse out can ******************* # STANDSTILL->WHEELS_MOVING bit can be noisy around zero, so use XMISSION_SPEED # panda checks if the signal is non-zero @@ -223,6 +215,14 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) + # is_metric_cruise is used for cruise speed display + # ACC_HUD is on camera bus on radarless cars + acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] + if acc_hud["CRUISE_SPEED"] >= 253: + self.is_metric_cruise = self.is_metric + else: + self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] + if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: From 59fb36ebba57cdf73a2df9b39a8d5f94c4f641f7 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 20:05:12 -0500 Subject: [PATCH 22/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index fc6e1ad3b8..095c26d040 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -222,7 +222,7 @@ def update(self, can_parsers) -> structs.CarState: self.is_metric_cruise = self.is_metric else: self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] - + if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: From a1c8fbfb93286297feafa5cd739e3218c334774e Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 20:18:31 -0500 Subject: [PATCH 23/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 095c26d040..9bb90ea362 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -215,13 +215,13 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) - # is_metric_cruise is used for cruise speed display # ACC_HUD is on camera bus on radarless cars acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] if acc_hud["CRUISE_SPEED"] >= 253: - self.is_metric_cruise = self.is_metric + self.is_metric_cruise = self.is_metric # is_metric_cruise is used for cruise speed display else: self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it @@ -229,17 +229,14 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = cp_cam.vl["ACC_HUD"]["CRUISE_CONTROL_LABEL"] != 0 if not self.CP.openpilotLongitudinalControl: - # ACC_HUD is on camera bus on radarless cars - acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: - ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS + ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * conversion if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 From a1832e121c2107bddff9165ef8374b8a968ae701 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 20:49:42 -0500 Subject: [PATCH 24/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 9bb90ea362..557f753611 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -215,15 +215,13 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) - # ACC_HUD is on camera bus on radarless cars - acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] - if acc_hud["CRUISE_SPEED"] >= 253: - self.is_metric_cruise = self.is_metric # is_metric_cruise is used for cruise speed display - else: - self.is_metric_cruise = not acc_hud["IMPERIAL_UNIT"] - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS - if self.CP.carFingerprint in HONDA_BOSCH: + # ACC_HUD is on camera bus on radarless cars + acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] + + # is_metric_cruise is used for cruise speed display + self.is_metric_cruise = self.is_metric if acc_hud["CRUISE_SPEED"] >= 253 else not acc_hud["IMPERIAL_UNIT"] + # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: ret.cruiseState.nonAdaptive = cp_cam.vl["ACC_HUD"]["CRUISE_CONTROL_LABEL"] != 0 @@ -232,12 +230,15 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: + self.is_metric_cruise = self.is_metric + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * conversion - + if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 else: From 4c52c919754d22dd6c1175dae18350489d4d792f Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 20:51:33 -0500 Subject: [PATCH 25/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 557f753611..e0e75bdae1 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -221,7 +221,7 @@ def update(self, can_parsers) -> structs.CarState: # is_metric_cruise is used for cruise speed display self.is_metric_cruise = self.is_metric if acc_hud["CRUISE_SPEED"] >= 253 else not acc_hud["IMPERIAL_UNIT"] - + # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: ret.cruiseState.nonAdaptive = cp_cam.vl["ACC_HUD"]["CRUISE_CONTROL_LABEL"] != 0 @@ -235,10 +235,10 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: - self.is_metric_cruise = self.is_metric + self.is_metric_cruise = self.is_metric conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * conversion - + if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 else: From aec73d8ebf96fa7ddad10835924269598a6dc991 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 20:57:39 -0500 Subject: [PATCH 26/54] Odyssey_5G_MMR --- opendbc/car/honda/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index af67e471cf..3db8d5a4f4 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -182,7 +182,7 @@ class CAR(Platforms): flags=HondaFlags.BOSCH_RADARLESS, ) HONDA_ODYSSEY_5G_MMR = HondaBoschPlatformConfig( - [HondaCarDocs("Honda Odyssey 2021-2025", "All", min_steer_speed=3. * CV.MPH_TO_MS)], + [HondaCarDocs("Honda Odyssey 2021-25", "All", min_steer_speed=3. * CV.MPH_TO_MS)], CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=13.35, centerToFrontRatio=0.54, tireStiffnessFactor=1.02), # as spec {Bus.pt: 'acura_rdx_2020_can_generated'}, flags=HondaFlags.BOSCH_ALT_BRAKE, From d5b4cd01c701a4d2640978e6a5eb0f3334ca32c6 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 21:25:39 -0500 Subject: [PATCH 27/54] Odyssey_5G_MMR --- opendbc/car/honda/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index 06adacb1e4..073072fb28 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -165,7 +165,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime elif candidate == CAR.HONDA_ODYSSEY_5G_MMR: if not ret.openpilotLongitudinalControl: - ret.minSteerSpeed = 70.0 * CV.KPH_TO_MS + ret.minSteerSpeed = 60.0 * CV.KPH_TO_MS # min is 70kph to activate but 60kph to deactive. Used 60kph to ensure steering is attempted ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # clipped by radar else: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end From 04d649ea80ae99430bba659f43fbbb5c06110434 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 21:52:07 -0500 Subject: [PATCH 28/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index e0e75bdae1..24815add04 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -259,7 +259,7 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph - ret.low_speed_alert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From 9a8c3fe29e05f11197eb32b5c88a836b0f355e70 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 22:44:06 -0500 Subject: [PATCH 29/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 24815add04..c2e7f51542 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -215,18 +215,25 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) - if self.CP.carFingerprint in HONDA_BOSCH: - # ACC_HUD is on camera bus on radarless cars - acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] - - # is_metric_cruise is used for cruise speed display - self.is_metric_cruise = self.is_metric if acc_hud["CRUISE_SPEED"] >= 253 else not acc_hud["IMPERIAL_UNIT"] + # is_metric_cruise is used for cruise speed display + if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS + if "ACC_HUD" in cp_cam.vl: + self.is_metric_cruise = self.is_metric if cp_cam.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp_cam.vl["ACC_HUD"]["IMPERIAL_UNIT"] + else: + self.is_metric_cruise = self.is_metric + elif "ACC_HUD" in cp.vl: + self.is_metric_cruise = self.is_metric if cp.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp.vl["ACC_HUD"]["IMPERIAL_UNIT"] + else: + self.is_metric_cruise = self.is_metric + if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: ret.cruiseState.nonAdaptive = cp_cam.vl["ACC_HUD"]["CRUISE_CONTROL_LABEL"] != 0 if not self.CP.openpilotLongitudinalControl: + # ACC_HUD is on camera bus on radarless cars + acc_hud = cp_cam.vl["ACC_HUD"] if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS else cp.vl["ACC_HUD"] ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. @@ -235,8 +242,6 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: - self.is_metric_cruise = self.is_metric - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * conversion if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: From ef9a4fbb82f9b04dd6cf7f062a46df3f3f0a6975 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 22:46:26 -0500 Subject: [PATCH 30/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index c2e7f51542..694b92451c 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -216,7 +216,7 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) # is_metric_cruise is used for cruise speed display - if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS + if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: if "ACC_HUD" in cp_cam.vl: self.is_metric_cruise = self.is_metric if cp_cam.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp_cam.vl["ACC_HUD"]["IMPERIAL_UNIT"] else: From 67c5f668e5af64ab349b74cd22a0ca4ec998da8d Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 22:49:47 -0500 Subject: [PATCH 31/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 694b92451c..7b79cbbed7 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -225,7 +225,8 @@ def update(self, can_parsers) -> structs.CarState: self.is_metric_cruise = self.is_metric if cp.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp.vl["ACC_HUD"]["IMPERIAL_UNIT"] else: self.is_metric_cruise = self.is_metric - + conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS + if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: @@ -237,7 +238,6 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed From 90edcc1336654b84dd6469a82dad362933d755d2 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 22:51:24 -0500 Subject: [PATCH 32/54] Odyssey_5G_MMR --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 7b79cbbed7..1da31fcf13 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -226,7 +226,7 @@ def update(self, can_parsers) -> structs.CarState: else: self.is_metric_cruise = self.is_metric conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS - + if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: From 7b878c291fa924abef12781393dc1d5746410ab8 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 22:55:23 -0500 Subject: [PATCH 33/54] Odyssey_5G_MMR --- opendbc/car/honda/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 486ce02e69..e80c95e7c1 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -210,7 +210,7 @@ def update(self, CC, CS, now_nanos): if self.CP.carFingerprint in HONDA_BOSCH: self.accel = float(np.clip(accel, self.params.BOSCH_ACCEL_MIN, self.params.BOSCH_ACCEL_MAX)) if self.CP.carFingerprint in HONDA_BOSCH_1000: - self.gas = float(np.interp(accel, self.params.BOSCH_1000_GAS_LOOKUP_BP, self.params.BOSCH_1000_GAS_LOOKUP_V)) + self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_1000_GAS_LOOKUP_V)) else: self.gas = float(np.interp(accel, self.params.BOSCH_GAS_LOOKUP_BP, self.params.BOSCH_GAS_LOOKUP_V)) From a0249c16fb2b921efb6773ed1070f72f1a43b659 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 23:13:34 -0500 Subject: [PATCH 34/54] Odyssey_5G_MMR --- opendbc/car/tests/routes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index e5267d1df8..1c2dc62092 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -97,6 +97,8 @@ class CarTestRoute(NamedTuple): CarTestRoute("f29e2b57a55e7ad5|2021-03-24--20-52-38", HONDA.HONDA_ACCORD), # hybrid, 2021 with new style HUD msgs CarTestRoute("1ad763dd22ef1a0e|2020-02-29--18-37-03", HONDA.HONDA_CRV_5G), CarTestRoute("0a96f86fcfe35964|2020-02-05--07-25-51", HONDA.HONDA_ODYSSEY), + #test below was on older code, just seeing if CI finds more problems before new testdrive, then will replace + CarTestRoute("558ac87ada6a88cd/00000034--54b3407485", HONDA.HONDA_ODYSSEY_5G_MMR), CarTestRoute("d83f36766f8012a5|2020-02-05--18-42-21", HONDA.HONDA_CIVIC_BOSCH_DIESEL), CarTestRoute("f0890d16a07a236b|2021-05-25--17-27-22", HONDA.HONDA_INSIGHT), CarTestRoute("07d37d27996096b6|2020-03-04--21-57-27", HONDA.HONDA_PILOT), From 90d6729dccf9fb50cb1ab67d5973bd3c98c2dd3c Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 6 Mar 2025 23:14:45 -0500 Subject: [PATCH 35/54] Odyssey_5G_MMR --- opendbc/car/tests/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 1c2dc62092..82c8ffd4d3 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -97,8 +97,8 @@ class CarTestRoute(NamedTuple): CarTestRoute("f29e2b57a55e7ad5|2021-03-24--20-52-38", HONDA.HONDA_ACCORD), # hybrid, 2021 with new style HUD msgs CarTestRoute("1ad763dd22ef1a0e|2020-02-29--18-37-03", HONDA.HONDA_CRV_5G), CarTestRoute("0a96f86fcfe35964|2020-02-05--07-25-51", HONDA.HONDA_ODYSSEY), - #test below was on older code, just seeing if CI finds more problems before new testdrive, then will replace - CarTestRoute("558ac87ada6a88cd/00000034--54b3407485", HONDA.HONDA_ODYSSEY_5G_MMR), + #test below was on older code, just seeing if CI finds more problems before new testdrive, then will replace + CarTestRoute("558ac87ada6a88cd/00000034--54b3407485", HONDA.HONDA_ODYSSEY_5G_MMR), CarTestRoute("d83f36766f8012a5|2020-02-05--18-42-21", HONDA.HONDA_CIVIC_BOSCH_DIESEL), CarTestRoute("f0890d16a07a236b|2021-05-25--17-27-22", HONDA.HONDA_INSIGHT), CarTestRoute("07d37d27996096b6|2020-03-04--21-57-27", HONDA.HONDA_PILOT), From 26ea3430b6042c38d06b26588ebe35dd4a0c7304 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:01:55 -0400 Subject: [PATCH 36/54] reverting unintentional edit From 74a4058cb70474b341c216ee08d51e81eaac87cb Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:04:12 -0400 Subject: [PATCH 37/54] Reverting to standard cruise speed conversion logic --- opendbc/car/honda/carcontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index e80c95e7c1..15602371cd 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -121,7 +121,7 @@ def __init__(self, dbc_names, CP): def update(self, CC, CS, now_nanos): actuators = CC.actuators hud_control = CC.hudControl - conversion = CV.KPH_TO_MS if CS.is_metric_cruise else CV.MPH_TO_MS + conversion = hondacan.get_cruise_speed_conversion(self.CP.carFingerprint, CS.is_metric) hud_v_cruise = hud_control.setSpeed / conversion if hud_control.speedVisible else 255 pcm_cancel_cmd = CC.cruiseControl.cancel From 55ace2bfe8a3646cc02998e5a3f66dc80b553f79 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:08:02 -0400 Subject: [PATCH 38/54] revert Cruise speed conversion --- opendbc/car/honda/carstate.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 1da31fcf13..ec7970c3f7 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -5,7 +5,7 @@ from opendbc.can.parser import CANParser from opendbc.car import Bus, create_button_events, structs from opendbc.car.common.conversions import Conversions as CV -from opendbc.car.honda.hondacan import CanBus +from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \ HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \ HondaFlags, CruiseButtons, CruiseSettings, GearShifter @@ -107,8 +107,7 @@ def __init__(self, CP): self.brake_switch_active = False self.cruise_setting = 0 self.v_cruise_pcm_prev = 0 - self.is_metric_cruise = False - + # When available we use cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] to populate vEgoCluster # However, on cars without a digital speedometer this is not always present (HRV, FIT, CRV 2016, ILX and RDX) self.dash_speed_seen = False @@ -215,18 +214,6 @@ def update(self, can_parsers) -> structs.CarState: ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD.get(self.CP.carFingerprint, 1200) - # is_metric_cruise is used for cruise speed display - if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: - if "ACC_HUD" in cp_cam.vl: - self.is_metric_cruise = self.is_metric if cp_cam.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp_cam.vl["ACC_HUD"]["IMPERIAL_UNIT"] - else: - self.is_metric_cruise = self.is_metric - elif "ACC_HUD" in cp.vl: - self.is_metric_cruise = self.is_metric if cp.vl["ACC_HUD"]["CRUISE_SPEED"] >= 253 else not cp.vl["ACC_HUD"]["IMPERIAL_UNIT"] - else: - self.is_metric_cruise = self.is_metric - conversion = CV.KPH_TO_MS if self.is_metric_cruise else CV.MPH_TO_MS - if self.CP.carFingerprint in HONDA_BOSCH: # The PCM always manages its own cruise control state, but doesn't publish it if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS: @@ -238,11 +225,12 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.nonAdaptive = acc_hud["CRUISE_CONTROL_LABEL"] != 0 ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. + conversion = get_cruise_speed_conversion(self.CP.carFingerprint, self.is_metric) # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: - ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * conversion + ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 @@ -264,7 +252,9 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph - ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + + if self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_5G_MMR): + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From 6df181ca691f1c00698f4401755978231371458b Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:10:17 -0400 Subject: [PATCH 39/54] Revert cruise speed conversion change --- opendbc/car/honda/hondacan.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opendbc/car/honda/hondacan.py b/opendbc/car/honda/hondacan.py index b314e568f9..88229c971d 100644 --- a/opendbc/car/honda/hondacan.py +++ b/opendbc/car/honda/hondacan.py @@ -44,6 +44,11 @@ def body(self) -> int: return self.offset +def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float: + # on certain cars, CRUISE_SPEED changes to imperial with car's unit setting + return CV.MPH_TO_MS if (car_fingerprint in HONDA_BOSCH_RADARLESS or car_fingerprint in CAR.HONDA_ODYSSEY_5G_MMR) and not is_metric else CV.KPH_TO_MS + + def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): # TODO: do we loose pressure if we keep pump off for long? brakelights = apply_brake > 0 From eafbd3fdfbfc46c232c01047a6851aeddf19ecea Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:11:46 -0400 Subject: [PATCH 40/54] Move speed cutoff to 70kph due to user warning --- opendbc/car/honda/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/interface.py b/opendbc/car/honda/interface.py index 073072fb28..d46591ed97 100755 --- a/opendbc/car/honda/interface.py +++ b/opendbc/car/honda/interface.py @@ -165,7 +165,7 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime elif candidate == CAR.HONDA_ODYSSEY_5G_MMR: if not ret.openpilotLongitudinalControl: - ret.minSteerSpeed = 60.0 * CV.KPH_TO_MS # min is 70kph to activate but 60kph to deactive. Used 60kph to ensure steering is attempted + ret.minSteerSpeed = 70.0 * CV.KPH_TO_MS # min is 70kph to activate but 60kph to deactive. Used 70kph to clarify for warning message ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # clipped by radar else: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end From 830a72c23bf5e1e4f006ca8805afec9cbb6e32f8 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:13:36 -0400 Subject: [PATCH 41/54] Revert cruise speed conversion change --- opendbc/car/honda/carcontroller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/opendbc/car/honda/carcontroller.py b/opendbc/car/honda/carcontroller.py index 15602371cd..06599ee6fe 100644 --- a/opendbc/car/honda/carcontroller.py +++ b/opendbc/car/honda/carcontroller.py @@ -4,7 +4,6 @@ from opendbc.can.packer import CANPacker from opendbc.car import Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs from opendbc.car.honda import hondacan -from opendbc.car.common.conversions import Conversions as CV from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, HONDA_BOSCH_1000, \ CarControllerParams from opendbc.car.interfaces import CarControllerBase From 140cc18b3a94d988b735e34741b76db2b0d353c4 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sat, 15 Mar 2025 20:15:11 -0400 Subject: [PATCH 42/54] typo fixes --- opendbc/car/honda/carstate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index ec7970c3f7..2bf0f19e8f 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -107,7 +107,7 @@ def __init__(self, CP): self.brake_switch_active = False self.cruise_setting = 0 self.v_cruise_pcm_prev = 0 - + # When available we use cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] to populate vEgoCluster # However, on cars without a digital speedometer this is not always present (HRV, FIT, CRV 2016, ILX and RDX) self.dash_speed_seen = False @@ -252,7 +252,6 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"]) # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph - if self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_5G_MMR): ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 From 1371a22d3f0886ec97ecb245c5b023b3eb5bf26e Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 11:25:11 -0400 Subject: [PATCH 43/54] tuning_updates --- opendbc/car/honda/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 3db8d5a4f4..5aa68b6fd4 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -183,7 +183,7 @@ class CAR(Platforms): ) HONDA_ODYSSEY_5G_MMR = HondaBoschPlatformConfig( [HondaCarDocs("Honda Odyssey 2021-25", "All", min_steer_speed=3. * CV.MPH_TO_MS)], - CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=13.35, centerToFrontRatio=0.54, tireStiffnessFactor=1.02), # as spec + CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=19.5, centerToFrontRatio=0.54, tireStiffnessFactor=1.18), # per spec + plotjuggler {Bus.pt: 'acura_rdx_2020_can_generated'}, flags=HondaFlags.BOSCH_ALT_BRAKE, ) From 5707b55bb1f4b668b65b0337515a962f6eaf8f7f Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 11:51:25 -0400 Subject: [PATCH 44/54] removing lowspeed warning when driver is actively driving --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 2bf0f19e8f..a28b3cbd07 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -253,7 +253,7 @@ def update(self, can_parsers) -> structs.CarState: # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph if self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_5G_MMR): - ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 and ret.steeringPressed == False # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From c86a17772ff00417e6979861b6d3d55512e3557d Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 11:52:27 -0400 Subject: [PATCH 45/54] typo fix --- opendbc/car/honda/carstate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index a28b3cbd07..ef18cd0501 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -253,7 +253,7 @@ def update(self, can_parsers) -> structs.CarState: # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph if self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_5G_MMR): - ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 and ret.steeringPressed == False + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 and not ret.steeringPressed # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From 1dee6b7914e531a4c8342591963f29a590311a34 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 11:53:40 -0400 Subject: [PATCH 46/54] formatting --- opendbc/car/honda/carstate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index ef18cd0501..30d2f55f74 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -253,7 +253,8 @@ def update(self, can_parsers) -> structs.CarState: # Adds low speed warning as some models disable cruise at various speeds, ignore warning under 3mph if self.CP.carFingerprint in (CAR.HONDA_ODYSSEY_5G_MMR): - ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 and not ret.steeringPressed + ret.lowSpeedAlert = ret.cruiseState.enabled and ret.vEgo >= 4 * CV.MPH_TO_MS and \ + cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] == 0 and not ret.steeringPressed # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): From 14f268a7e63e9be4d6832eaf9f8e2226431f3f0d Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 14:20:27 -0400 Subject: [PATCH 47/54] formatting From 4b6a9844707feedd96d077569360edf7be4f7a78 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 14:22:02 -0400 Subject: [PATCH 48/54] Update CARS.md --- docs/CARS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index dc72493394..d7e4a79577 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -87,7 +87,7 @@ |Honda|Insight 2019-22|All|[Upstream](#upstream)| |Honda|Inspire 2018|All|[Upstream](#upstream)| |Honda|Odyssey 2018-20|Honda Sensing|[Upstream](#upstream)| -|Honda|Odyssey 2021-25|All|[Upstream](#upstream)| +|Honda|Odysseya 2021-25|All|[Upstream](#upstream)| |Honda|Passport 2019-23|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| |Honda|Pilot 2023-24|All|[Community](#community)| From da162193f8b4639b3be452c862bdd71e0ede6e81 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 14:22:37 -0400 Subject: [PATCH 49/54] formatting --- docs/CARS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index d7e4a79577..dc72493394 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -87,7 +87,7 @@ |Honda|Insight 2019-22|All|[Upstream](#upstream)| |Honda|Inspire 2018|All|[Upstream](#upstream)| |Honda|Odyssey 2018-20|Honda Sensing|[Upstream](#upstream)| -|Honda|Odysseya 2021-25|All|[Upstream](#upstream)| +|Honda|Odyssey 2021-25|All|[Upstream](#upstream)| |Honda|Passport 2019-23|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| |Honda|Pilot 2023-24|All|[Community](#community)| From 960cd4cb18d9169bb4b2ff86e8b0107117ec5298 Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 22:41:36 -0400 Subject: [PATCH 50/54] Tuning --- opendbc/car/torque_data/params.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/torque_data/params.toml b/opendbc/car/torque_data/params.toml index e0190aa658..8184685cfb 100644 --- a/opendbc/car/torque_data/params.toml +++ b/opendbc/car/torque_data/params.toml @@ -20,7 +20,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "HONDA_HRV" = [2.0661212805710205, 0.7521343418694775, 0.17760375789242094] "HONDA_INSIGHT" = [1.5201671214069354, 0.5660229120683284, 0.25808042580281876] "HONDA_ODYSSEY" = [1.8774809275211801, 0.8394431662987996, 0.2096978613792822] -"HONDA_ODYSSEY_5G_MMR" = [1.6, 0.8394431662987996, 0.226] +"HONDA_ODYSSEY_5G_MMR" = [1.51, 0.33874701282109954, 0.226] "HONDA_PILOT" = [1.7262026201812795, 0.9470005614967523, 0.21351430733218763] "HONDA_RIDGELINE" = [1.4146525028237624, 0.7356572861629564, 0.23307177552211328] "HYUNDAI_ELANTRA_2021" = [3.169, 2.1259108157250735, 0.0819] From a5e59897c70739db9fd1a044892b900ec75df1cb Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Sun, 16 Mar 2025 22:42:46 -0400 Subject: [PATCH 51/54] tuning --- opendbc/car/honda/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 5aa68b6fd4..18d13e27c2 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -183,7 +183,7 @@ class CAR(Platforms): ) HONDA_ODYSSEY_5G_MMR = HondaBoschPlatformConfig( [HondaCarDocs("Honda Odyssey 2021-25", "All", min_steer_speed=3. * CV.MPH_TO_MS)], - CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=19.5, centerToFrontRatio=0.54, tireStiffnessFactor=1.18), # per spec + plotjuggler + CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=19.4, centerToFrontRatio=0.54, tireStiffnessFactor=1.02), # per spec + plotjuggler {Bus.pt: 'acura_rdx_2020_can_generated'}, flags=HondaFlags.BOSCH_ALT_BRAKE, ) From 9c3d91eb7f4acd675682f15a5105f1eded0109dc Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Mon, 24 Mar 2025 08:18:10 -0400 Subject: [PATCH 52/54] Centertofront - match earlier Odyssey --- opendbc/car/honda/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/honda/values.py b/opendbc/car/honda/values.py index 18d13e27c2..4df6d10b60 100644 --- a/opendbc/car/honda/values.py +++ b/opendbc/car/honda/values.py @@ -183,7 +183,7 @@ class CAR(Platforms): ) HONDA_ODYSSEY_5G_MMR = HondaBoschPlatformConfig( [HondaCarDocs("Honda Odyssey 2021-25", "All", min_steer_speed=3. * CV.MPH_TO_MS)], - CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=19.4, centerToFrontRatio=0.54, tireStiffnessFactor=1.02), # per spec + plotjuggler + CarSpecs(mass=4590 * CV.LB_TO_KG, wheelbase=3.00, steerRatio=19.4, centerToFrontRatio=0.41, tireStiffnessFactor=1.02), # per spec + plotjuggler {Bus.pt: 'acura_rdx_2020_can_generated'}, flags=HondaFlags.BOSCH_ALT_BRAKE, ) From 9c5f6cf145d34d33f35337f2ac2fdf7a7c51de7e Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Mon, 24 Mar 2025 08:19:24 -0400 Subject: [PATCH 53/54] Adding new route --- opendbc/car/tests/routes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 6a011e54ad..4aab2cbcce 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -97,8 +97,7 @@ class CarTestRoute(NamedTuple): CarTestRoute("f29e2b57a55e7ad5|2021-03-24--20-52-38", HONDA.HONDA_ACCORD), # hybrid, 2021 with new style HUD msgs CarTestRoute("1ad763dd22ef1a0e|2020-02-29--18-37-03", HONDA.HONDA_CRV_5G), CarTestRoute("0a96f86fcfe35964|2020-02-05--07-25-51", HONDA.HONDA_ODYSSEY), - #test below was on older code, just seeing if CI finds more problems before new testdrive, then will replace - CarTestRoute("558ac87ada6a88cd/00000034--54b3407485", HONDA.HONDA_ODYSSEY_5G_MMR), + CarTestRoute("558ac87ada6a88cd/0000005b--0d40d84bb6", HONDA.HONDA_ODYSSEY_5G_MMR), CarTestRoute("d83f36766f8012a5|2020-02-05--18-42-21", HONDA.HONDA_CIVIC_BOSCH_DIESEL), CarTestRoute("f0890d16a07a236b|2021-05-25--17-27-22", HONDA.HONDA_INSIGHT), CarTestRoute("07d37d27996096b6|2020-03-04--21-57-27", HONDA.HONDA_PILOT), From a3c45f1499990e797f017051e328c4837500b77a Mon Sep 17 00:00:00 2001 From: mvl-boston Date: Thu, 27 Mar 2025 13:40:55 -0400 Subject: [PATCH 54/54] Upgrading Odyssey support to upstream --- docs/CARS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index a3308d80c8..0cc8e6ead7 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -87,7 +87,7 @@ |Honda|Insight 2019-22|All|[Upstream](#upstream)| |Honda|Inspire 2018|All|[Upstream](#upstream)| |Honda|Odyssey 2018-20|Honda Sensing|[Upstream](#upstream)| -|Honda|Odyssey 2021-25|All|[Community](#community)| +|Honda|Odyssey 2021-25|All|[Upstream](#upstream)| |Honda|Passport 2019-25|All|[Upstream](#upstream)| |Honda|Pilot 2016-22|Honda Sensing|[Upstream](#upstream)| |Honda|Pilot 2023-24|All|[Community](#community)|