[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 <shane@smiskol.com>
pull/30906/head
DevTekVE 1 year ago committed by GitHub
parent 115047d858
commit 28cf3155e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      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:

Loading…
Cancel
Save