From aa089fc64f4836bade6e99abaf71de4f85e80d20 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:31:16 -0500 Subject: [PATCH] oopsie --- opendbc_repo/opendbc/car/hyundai/carstate.py | 4 +-- .../opendbc/car/hyundai/tests/test_hyundai.py | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/opendbc_repo/opendbc/car/hyundai/carstate.py b/opendbc_repo/opendbc/car/hyundai/carstate.py index 16e0dce1d..7c6f9e528 100644 --- a/opendbc_repo/opendbc/car/hyundai/carstate.py +++ b/opendbc_repo/opendbc/car/hyundai/carstate.py @@ -366,8 +366,8 @@ class CarState(CarStateBase): else: cam_msgs.append(("FR_CMR_02_100ms", 0)) # optional: not all non-LKA CANFD cars have this on CAM bus if CP.flags & HyundaiFlags.EV: - msgs.append(("DRIVE_MODE_EV", 10)) - msgs.append(("STEERING_WHEEL_MEDIA_BUTTONS", 50)) + msgs.append(("DRIVE_MODE_EV", 0)) # optional: not all CAN-FD EV variants publish drive mode + msgs.append(("STEERING_WHEEL_MEDIA_BUTTONS", 0)) # optional: absent or slower on some CAN-FD variants return { Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], msgs, CanBus(CP).ECAN), Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], cam_msgs, CanBus(CP).CAM), diff --git a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py index 50efb8d0d..5df771d69 100644 --- a/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py +++ b/opendbc_repo/opendbc/car/hyundai/tests/test_hyundai.py @@ -191,6 +191,31 @@ class TestHyundaiFingerprint: assert sportage_params.ANGLE_LIMITS.MAX_LATERAL_JERK < comparison_params.ANGLE_LIMITS.MAX_LATERAL_JERK assert comparison_params.ANGLE_LIMITS.MAX_LATERAL_JERK == ioniq6_params.ANGLE_LIMITS.MAX_LATERAL_JERK + def test_ioniq_5_canfd_aux_messages_are_optional(self): + toggles = get_test_toggles() + fingerprint = gen_empty_fingerprint() + CP = CarInterface.get_params(CAR.HYUNDAI_IONIQ_5, fingerprint, [], False, False, False, toggles) + FPCP = CarInterface.get_starpilot_params(CAR.HYUNDAI_IONIQ_5, fingerprint, [], CP, toggles) + + car_state = CarState(CP, FPCP) + can_parsers = car_state.get_can_parsers(CP) + packer = CANPacker(DBC[CP.carFingerprint][Bus.pt]) + + drive_mode_addr = packer.dbc.name_to_msg["DRIVE_MODE_EV"].address + media_buttons_addr = packer.dbc.name_to_msg["STEERING_WHEEL_MEDIA_BUTTONS"].address + + assert can_parsers[Bus.pt].message_states[drive_mode_addr].ignore_alive + assert can_parsers[Bus.pt].message_states[media_buttons_addr].ignore_alive + + for frame in range(1, 6): + t = frame * 100_000_000 + for parser in can_parsers.values(): + required_msgs = [packer.make_can_msg(state.name, parser.bus, {}) + for state in parser.message_states.values() if not state.ignore_alive] + parser.update([(t, required_msgs)]) + + assert all(parser.can_valid for parser in can_parsers.values()) + def test_blacklisted_parts(self, subtests): # Asserts no ECUs known to be shared across platforms exist in the database. # Tucson having Santa Cruz camera and EPS for example