hyundai: support for controlling cruise speed via HDA (#19635)

old-commit-hash: f205f97be0
This commit is contained in:
Greg Hogan 2021-01-12 11:50:08 -08:00 committed by GitHub
parent 74dc639515
commit b310398dd2
4 changed files with 9 additions and 19 deletions

@ -1 +1 @@
Subproject commit b54a68d14075a64a4c70a677518bfff2d7cfa3be
Subproject commit 4e8914f0c22eb4a7754e80b229b2eeec3ac22ec6

View File

@ -1,7 +1,7 @@
from cereal import car
from common.realtime import DT_CTRL
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfa_mfa
from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfahda_mfc
from selfdrive.car.hyundai.values import Buttons, CarControllerParams, CAR
from opendbc.can.packer import CANPacker
@ -82,6 +82,6 @@ class CarController():
# 20 Hz LFA MFA message
if frame % 5 == 0 and self.car_fingerprint in [CAR.SONATA, CAR.PALISADE, CAR.IONIQ, CAR.KIA_NIRO_EV, CAR.IONIQ_EV_2020]:
can_sends.append(create_lfa_mfa(self.packer, frame, enabled))
can_sends.append(create_lfahda_mfc(self.packer, enabled))
return can_sends

View File

@ -294,7 +294,7 @@ class CarState(CarStateBase):
("CF_Lkas_FcwCollisionWarning", "LKAS11", 0),
("CF_Lkas_FusionState", "LKAS11", 0),
("CF_Lkas_FcwOpt_USM", "LKAS11", 0),
("CF_Lkas_LdwsOpt_USM", "LKAS11", 0)
("CF_Lkas_LdwsOpt_USM", "LKAS11", 0),
]
checks = [

View File

@ -67,21 +67,11 @@ def create_clu11(packer, frame, clu11, button):
return packer.make_can_msg("CLU11", 0, values)
def create_lfa_mfa(packer, frame, enabled):
def create_lfahda_mfc(packer, enabled, hda_set_speed=0):
values = {
"ACTIVE": enabled,
"LFA_Icon_State": 2 if enabled else 0,
"HDA_Active": 1 if hda_set_speed else 0,
"HDA_Icon_State": 2 if hda_set_speed else 0,
"HDA_VSetReq": hda_set_speed,
}
# ACTIVE 1 = Green steering wheel icon
# LFA_USM 2 & 3 = LFA cancelled, fast loud beeping
# LFA_USM 0 & 1 = No mesage
# LFA_SysWarning 1 = "Switching to HDA", short beep
# LFA_SysWarning 2 = "Switching to Smart Cruise control", short beep
# LFA_SysWarning 3 = LFA error
# ACTIVE2: nothing
# HDA_USM: nothing
return packer.make_can_msg("LFAHDA_MFC", 0, values)