From 28cf3155e21da663040040076f9fb9e746fd6834 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Thu, 4 Jan 2024 04:34:13 +0100 Subject: [PATCH] [HKG-CAN] Consider FCW alerts from SCC (#30885) * FCW is triggered differently when SCC is active * Update selfdrive/car/hyundai/carstate.py * Update selfdrive/car/hyundai/carstate.py * cmt --------- Co-authored-by: Shane Smiskol --- selfdrive/car/hyundai/carstate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index edc9e4855f..2f1fb10804 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -147,8 +147,9 @@ class CarState(CarStateBase): aeb_src = "FCA11" if self.CP.flags & HyundaiFlags.USE_FCA.value else "SCC12" aeb_sig = "FCA_CmdAct" if self.CP.flags & HyundaiFlags.USE_FCA.value else "AEB_CmdAct" aeb_warning = cp_cruise.vl[aeb_src]["CF_VSM_Warn"] != 0 + scc_warning = cp_cruise.vl["SCC12"]["TakeOverReq"] == 1 # sometimes only SCC system shows an FCW aeb_braking = cp_cruise.vl[aeb_src]["CF_VSM_DecCmdAct"] != 0 or cp_cruise.vl[aeb_src][aeb_sig] != 0 - ret.stockFcw = aeb_warning and not aeb_braking + ret.stockFcw = (aeb_warning or scc_warning) and not aeb_braking ret.stockAeb = aeb_warning and aeb_braking if self.CP.enableBsm: