Skip to content

Commit

Permalink
Honda Civic 2022: fix spotty camera query (commaai#31963)
Browse files Browse the repository at this point in the history
* no extra ecu

* cmt

* documentation

* update refs

* nice

* for testing

* byebye

* Update launch_openpilot.sh
  • Loading branch information
sshane authored Mar 22, 2024
1 parent 108e033 commit d5cd457
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
22 changes: 9 additions & 13 deletions selfdrive/car/honda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
),
Expand Down Expand Up @@ -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),
],
)

Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/tests/test_fw_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d5cd457

Please sign in to comment.