diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 7865e4c956..1e4ad4018e 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -120,8 +120,9 @@ class CarState(CarStateBase): ret.stockAeb = cp.vl["SCC12"]['AEB_CmdAct'] != 0 ret.stockFcw = cp.vl["SCC12"]['CF_VSM_Warn'] == 2 - ret.leftBlindspot = cp.vl["LCA11"]["CF_Lca_IndLeft"] != 0 - ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0 + if self.CP.carFingerprint in FEATURES["use_bsm"]: + ret.leftBlindspot = cp.vl["LCA11"]["CF_Lca_IndLeft"] != 0 + ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0 # save the entire LKAS11 and CLU11 self.lkas11 = cp_cam.vl["LKAS11"] @@ -179,9 +180,6 @@ class CarState(CarStateBase): ("CF_Lvr_GearInf", "LVR11", 0), # Transmission Gear (0 = N or P, 1-8 = Fwd, 14 = Rev) - ("CF_Lca_IndLeft", "LCA11", 0), - ("CF_Lca_IndRight", "LCA11", 0), - ("CR_Mdps_StrColTq", "MDPS12", 0), ("CF_Mdps_ToiActive", "MDPS12", 0), ("CF_Mdps_ToiUnavail", "MDPS12", 0), @@ -211,9 +209,15 @@ class CarState(CarStateBase): ("SAS11", 100), ("SCC11", 50), ("SCC12", 50), - ("LCA11", 50), ] + if CP.carFingerprint in FEATURES["use_bsm"]: + signals += [ + ("CF_Lca_IndLeft", "LCA11", 0), + ("CF_Lca_IndRight", "LCA11", 0), + ] + checks += [("LCA11", 50)] + if CP.carFingerprint in EV_HYBRID: signals += [ ("Accel_Pedal_Pos", "E_EMS11", 0), diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 1e564f377c..e19db60c89 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -213,6 +213,8 @@ FEATURES = { # these cars use the FCA11 message for the AEB and FCW signals, all others use SCC12 "use_fca": [CAR.SONATA, CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.KIA_STINGER, CAR.IONIQ, CAR.KONA, CAR.KONA_EV, CAR.KIA_FORTE, CAR.PALISADE], + + "use_bsm": [CAR.SONATA], } EV_HYBRID = [CAR.IONIQ_EV_LTD, CAR.IONIQ, CAR.KONA_EV]