Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HKG: Car Port for Kia Carnival 2025 (HDA2) #1558

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions opendbc/car/hyundai/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,13 +1152,17 @@
b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.05 99210-R0000 201221',
b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.06 99210-R0000 220221',
b'\xf1\x00KA4CMFC AT CHN LHD 1.00 1.01 99211-I4000 210525',
b'\xf1\x00KA4HMFC AT USA LHD 1.00 1.05 99210-R0500 240305',
b'\xf1\x00KA4 MFC AT USA LHD 1.00 1.05 99210-R0500 240305',
],
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00KA4_ SCC F-CUP 1.00 1.03 99110-R0000 ',
b'\xf1\x00KA4_ SCC FHCUP 1.00 1.00 99110-R0100 ',
b'\xf1\x00KA4_ SCC FHCUP 1.00 1.02 99110-R0000 ',
b'\xf1\x00KA4_ SCC FHCUP 1.00 1.03 99110-R0000 ',
b'\xf1\x00KA4c SCC FHCUP 1.00 1.01 99110-I4000 ',
b'\xf1\x00KAhe RDR ----- 1.00 1.01 99110-ES500 ',
b'\xf1\x00KA4_ SCC FHCUP 1.00 1.01 99110-R0510 ',
],
},
CAR.KIA_K8_HEV_1ST_GEN: {
Expand Down
12 changes: 7 additions & 5 deletions opendbc/car/hyundai/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.experimentalLongitudinalAvailable = candidate not in (CANFD_UNSUPPORTED_LONGITUDINAL_CAR | CANFD_RADAR_SCC_CAR)
ret.enableBsm = 0x1e5 in fingerprint[CAN.ECAN]

if 0x105 in fingerprint[CAN.ECAN]:
ret.flags |= HyundaiFlags.HYBRID.value
for fw in car_fw:
if fw.ecu == "fwdCamera" and (fw.fwVersion.startswith(b'\xf1\x00KA4HMFC')):
ret.flags |= HyundaiFlags.HYBRID.value

# detect HDA2 with ADAS Driving ECU
if hda2:
ret.flags |= HyundaiFlags.CANFD_HDA2.value
if 0x110 in fingerprint[CAN.CAM]:
ret.flags |= HyundaiFlags.CANFD_HDA2_ALT_STEERING.value
else:
# non-HDA2
if 0x1cf not in fingerprint[CAN.ECAN]:
ret.flags |= HyundaiFlags.CANFD_ALT_BUTTONS.value
if not ret.flags & HyundaiFlags.RADAR_SCC:
ret.flags |= HyundaiFlags.CANFD_CAMERA_SCC.value

Expand All @@ -52,6 +50,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
else:
ret.flags |= HyundaiFlags.CANFD_ALT_GEARS.value

# Some HDA2 do not have 0x1cf
if 0x1cf not in fingerprint[CAN.ECAN]:
ret.flags |= HyundaiFlags.CANFD_ALT_BUTTONS.value

cfgs = [get_safety_config(structs.CarParams.SafetyModel.hyundaiCanfd), ]
if CAN.ECAN >= 4:
cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput))
Expand Down
6 changes: 3 additions & 3 deletions opendbc/car/hyundai/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,11 @@ class CAR(Platforms):
)
KIA_CARNIVAL_4TH_GEN = HyundaiCanFDPlatformConfig(
[
HyundaiCarDocs("Kia Carnival 2022-24", car_parts=CarParts.common([CarHarness.hyundai_a])),
HyundaiCarDocs("Kia Carnival (China only) 2023", car_parts=CarParts.common([CarHarness.hyundai_k]))
HyundaiCarDocs("Kia Carnival 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
HyundaiCarDocs("Kia Carnival (China only) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
HyundaiCarDocs("Kia Carnival (with HDA II) 2025", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])),
],
CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23),
flags=HyundaiFlags.RADAR_SCC,
)

# Genesis
Expand Down
Loading