mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-27 00:42:05 +08:00
hyundai: match stock when aeb is disabled (#22580)
* match stock when aeb is disabled * add comment about instrument cluster warning
This commit is contained in:
@@ -121,6 +121,9 @@ def create_acc_commands(packer, enabled, accel, jerk, idx, lead_visible, set_spe
|
||||
# test: [(idx % 0xF, -((idx % 0xF) + 2) % 4) for idx in range(0x14)]
|
||||
"CR_FCA_Alive": ((-((idx % 0xF) + 2) % 4) << 2) + 1,
|
||||
"Supplemental_Counter": idx % 0xF,
|
||||
"PAINT1_Status": 1,
|
||||
"FCA_DrvSetStatus": 1,
|
||||
"FCA_Status": 1, # AEB disabled
|
||||
}
|
||||
fca11_dat = packer.make_can_msg("FCA11", 0, fca11_values)[2]
|
||||
fca11_values["CR_FCA_ChkSum"] = 0x10 - sum([sum(divmod(i, 16)) for i in fca11_dat]) % 0x10
|
||||
@@ -139,10 +142,8 @@ def create_acc_opt(packer):
|
||||
commands.append(packer.make_can_msg("SCC13", 0, scc13_values))
|
||||
|
||||
fca12_values = {
|
||||
# stock values may be needed if openpilot has vision based AEB some day
|
||||
# for now we are not setting these because there is no AEB for vision only
|
||||
# "FCA_USM": 3,
|
||||
# "FCA_DrvSetState": 2,
|
||||
"FCA_DrvSetState": 2,
|
||||
"FCA_USM": 1, # AEB disabled
|
||||
}
|
||||
commands.append(packer.make_can_msg("FCA12", 0, fca12_values))
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundai, 0)]
|
||||
ret.radarOffCan = RADAR_START_ADDR not in fingerprint[1]
|
||||
|
||||
# WARNING: disabling radar also disables AEB (and we show the same warning on the instrument cluster as if you manually disabled AEB)
|
||||
ret.openpilotLongitudinalControl = Params().get_bool("DisableRadar") and candidate in [CAR.SONATA, CAR.SONATA_HYBRID, CAR.PALISADE, CAR.SANTA_FE]
|
||||
|
||||
ret.pcmCruise = not ret.openpilotLongitudinalControl
|
||||
|
||||
Reference in New Issue
Block a user