From 43eefed5142bdf523dd2402085744f1086d3100f Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 12 Apr 2025 12:22:42 -0400 Subject: [PATCH] Hyundai longitudinal: Parse lead info for camera-based SCC platforms (#809) * Hyundai longitudinal: Parse lead info for camera-based SCC platforms * fix * update * bump * update tests * lol why is this here * bump --------- Co-authored-by: DevTekVE Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com> --- opendbc_repo | 2 +- selfdrive/controls/radard.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index 807ce9ff4..7942a631b 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 807ce9ff4329c4b42c3a331204bd9a7c130cbde4 +Subproject commit 7942a631bd4ff84a6a20ad36a16a36861eaf2543 diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index a5dd3400e..bee424405 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -13,6 +13,7 @@ from openpilot.common.swaglog import cloudlog from openpilot.common.simple_kalman import KF1D from opendbc.car import structs +from opendbc.car.hyundai.values import HyundaiFlags from opendbc.sunnypilot.car.hyundai.values import HyundaiFlagsSP @@ -188,7 +189,8 @@ def get_lead(v_ego: float, ready: bool, tracks: dict[int, Track], lead_msg: capn def get_custom_yrel(CP: structs.CarParams, CP_SP: structs.CarParamsSP, lead_dict: dict[str, Any], lead_msg: capnp._DynamicStructReader) -> dict[str, Any]: - if CP.brand == "hyundai" and CP_SP.flags & HyundaiFlagsSP.ENHANCED_SCC: + if CP.brand == "hyundai" and (CP_SP.flags & HyundaiFlagsSP.ENHANCED_SCC or + CP.flags & (HyundaiFlags.CANFD_CAMERA_SCC | HyundaiFlags.CAMERA_SCC)): lead_dict['yRel'] = float(-lead_msg.y[0]) return lead_dict