Hyundai: use SCC12 for stock ADAS signals on cars that don't have FCA11 (#1849)

* some hyundai use SCC12 for AEB/FCW

* add other cars from fingerprints

* comment
pull/1851/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent 03e824a4b5
commit 7cfdeb1a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      selfdrive/car/hyundai/carstate.py
  2. 10
      selfdrive/car/hyundai/values.py

@ -113,9 +113,13 @@ class CarState(CarStateBase):
else: else:
ret.gearShifter = GearShifter.unknown ret.gearShifter = GearShifter.unknown
ret.stockAeb = cp.vl["FCA11"]['FCA_CmdAct'] != 0 if self.CP.carFingerprint in FEATURES["use_fca"]:
ret.stockFcw = cp.vl["FCA11"]['CF_VSM_Warn'] == 2 ret.stockAeb = cp.vl["FCA11"]['FCA_CmdAct'] != 0
ret.stockFcw = cp.vl["FCA11"]['CF_VSM_Warn'] == 2
else:
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.leftBlindspot = cp.vl["LCA11"]["CF_Lca_IndLeft"] != 0
ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0 ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0
@ -174,7 +178,7 @@ class CarState(CarStateBase):
("ESC_Off_Step", "TCS15", 0), ("ESC_Off_Step", "TCS15", 0),
("CF_Lvr_GearInf", "LVR11", 0), # Transmission Gear (0 = N or P, 1-8 = Fwd, 14 = Rev) ("CF_Lvr_GearInf", "LVR11", 0), # Transmission Gear (0 = N or P, 1-8 = Fwd, 14 = Rev)
("CF_Lca_IndLeft", "LCA11", 0), ("CF_Lca_IndLeft", "LCA11", 0),
("CF_Lca_IndRight", "LCA11", 0), ("CF_Lca_IndRight", "LCA11", 0),
@ -187,9 +191,6 @@ class CarState(CarStateBase):
("SAS_Angle", "SAS11", 0), ("SAS_Angle", "SAS11", 0),
("SAS_Speed", "SAS11", 0), ("SAS_Speed", "SAS11", 0),
("FCA_CmdAct", "FCA11", 0),
("CF_VSM_Warn", "FCA11", 0),
("MainMode_ACC", "SCC11", 0), ("MainMode_ACC", "SCC11", 0),
("VSetDis", "SCC11", 0), ("VSetDis", "SCC11", 0),
("SCCInfoDisplay", "SCC11", 0), ("SCCInfoDisplay", "SCC11", 0),
@ -210,7 +211,6 @@ class CarState(CarStateBase):
("SAS11", 100), ("SAS11", 100),
("SCC11", 50), ("SCC11", 50),
("SCC12", 50), ("SCC12", 50),
("FCA11", 50),
("LCA11", 50), ("LCA11", 50),
] ]
@ -259,6 +259,18 @@ class CarState(CarStateBase):
("LVR12", 100) ("LVR12", 100)
] ]
if CP.carFingerprint in FEATURES["use_fca"]:
signals += [
("FCA_CmdAct", "FCA11", 0),
("CF_VSM_Warn", "FCA11", 0),
]
checks += [("FCA11", 50)]
else:
signals += [
("AEB_CmdAct", "SCC12", 0),
("CF_VSM_Warn", "SCC12", 0),
]
return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0) return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0)
@staticmethod @staticmethod

@ -206,9 +206,13 @@ CHECKSUM = {
} }
FEATURES = { FEATURES = {
"use_cluster_gears": [CAR.ELANTRA, CAR.KONA, CAR.ELANTRA_GT_I30], # Use Cluster for Gear Selection, rather than Transmission # which message has the gear
"use_tcu_gears": [CAR.KIA_OPTIMA, CAR.SONATA_2019], # Use TCU Message for Gear Selection "use_cluster_gears": [CAR.ELANTRA, CAR.KONA, CAR.ELANTRA_GT_I30],
"use_elect_gears": [CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ], # Use TCU Message for Gear Selection "use_tcu_gears": [CAR.KIA_OPTIMA, CAR.SONATA_2019],
"use_elect_gears": [CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ],
# 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],
} }
EV_HYBRID = [CAR.IONIQ_EV_LTD, CAR.IONIQ, CAR.KONA_EV] EV_HYBRID = [CAR.IONIQ_EV_LTD, CAR.IONIQ, CAR.KONA_EV]

Loading…
Cancel
Save