From d5cd457f827d698a1f4298d8efdda9800a87c018 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 21 Mar 2024 18:49:18 -0700 Subject: [PATCH] Honda Civic 2022: fix spotty camera query (#31963) * no extra ecu * cmt * documentation * update refs * nice * for testing * byebye * Update launch_openpilot.sh --- selfdrive/car/honda/values.py | 22 +++++++++------------- selfdrive/car/tests/test_fw_fingerprint.py | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index 1f59bd24d00893..ceb1d4f27ebbc6 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -261,9 +261,9 @@ class CAR(Platforms): ) -HONDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ +HONDA_ALT_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ p16(0xF112) -HONDA_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ +HONDA_ALT_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ p16(0xF112) FW_QUERY_CONFIG = FwQueryConfig( @@ -276,17 +276,10 @@ class CAR(Platforms): ), # Data collection requests: - # Attempt to get the radarless Civic 2022+ camera FW + # Log manufacturer-specific identifier for current ECUs Request( - [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.UDS_VERSION_REQUEST], - [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.UDS_VERSION_RESPONSE], - bus=0, - logging=True - ), - # Log extra identifiers for current ECUs - Request( - [HONDA_VERSION_REQUEST], - [HONDA_VERSION_RESPONSE], + [HONDA_ALT_VERSION_REQUEST], + [HONDA_ALT_VERSION_RESPONSE], bus=1, logging=True, ), @@ -326,7 +319,10 @@ class CAR(Platforms): }, extra_ecus=[ # The only other ECU on PT bus accessible by camera on radarless Civic - (Ecu.unknown, 0x18DAB3F1, None), + # This is likely a manufacturer-specific sub-address implementation: the camera responds to this and 0x18dab0f1 + # Unclear what the part number refers to: 8S103 is 'Camera Set Mono', while 36160 is 'Camera Monocular - Honda' + # TODO: add query back, camera does not support querying both in parallel and 0x18dab0f1 often fails to respond + # (Ecu.unknown, 0x18DAB3F1, None), ], ) diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index d9bea3b96530fb..17ffc358f118d4 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -263,14 +263,14 @@ def fake_get_ecu_addrs(*_, timeout): print(f'get_vin {name} case, query time={self.total_time / self.N} seconds') def test_fw_query_timing(self): - total_ref_time = {1: 8.6, 2: 9.5} + total_ref_time = {1: 8.5, 2: 9.4} brand_ref_times = { 1: { 'gm': 1.0, 'body': 0.1, 'chrysler': 0.3, 'ford': 1.5, - 'honda': 0.55, + 'honda': 0.45, 'hyundai': 1.05, 'mazda': 0.1, 'nissan': 0.8,