Skip to content

Commit

Permalink
Add support for Hyundai Ioniq 5 PE model
Browse files Browse the repository at this point in the history
The Hyundai Ioniq 5 PE model has been added to the fingerprint definitions in `fingerprints.py` and the car values in `values.py`. Additionally, adjustments have been made in `carcontroller.py`, `carstate.py`, and `interface.py` to properly support this new model's CAN FD signals and HDA II feature. A torque data override for the Ioniq 5 PE has also been set in `override.toml`.
  • Loading branch information
devtekve committed Jan 29, 2025
1 parent 4cac064 commit 36efc3b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion opendbc/car/hyundai/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def update(self, CC, CC_SP, CS, now_nanos):
self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING))

# LFA and HDA icons
update_lfahda_icons = (not hda2 or hda2_long) or self.CP.carFingerprint == CAR.KIA_EV9
update_lfahda_icons = (not hda2 or hda2_long) or self.CP.flags & HyundaiFlags.ANGLE_CONTROL
if self.frame % 5 == 0 and update_lfahda_icons:
can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled, self.lfa_icon))

Expand Down
4 changes: 2 additions & 2 deletions opendbc/car/hyundai/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ def update_canfd(self, can_parsers) -> structs.CarState:

# TODO: alt signal usage may be described by cp.vl['BLINKERS']['USE_ALT_LAMP']
left_blinker_sig, right_blinker_sig = "LEFT_LAMP", "RIGHT_LAMP"
if self.CP.carFingerprint in (CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_EV9):
if self.CP.carFingerprint in (CAR.HYUNDAI_KONA_EV_2ND_GEN, CAR.KIA_EV9) or self.CP.flags & HyundaiFlags.ANGLE_CONTROL:
left_blinker_sig, right_blinker_sig = "LEFT_LAMP_ALT", "RIGHT_LAMP_ALT"
ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["BLINKERS"][left_blinker_sig],
cp.vl["BLINKERS"][right_blinker_sig])
if self.CP.enableBsm:
if self.CP.carFingerprint == CAR.KIA_EV9:
if self.CP.flags & HyundaiFlags.ANGLE_CONTROL:
ret.leftBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["INDICATOR_LEFT_FOUR"] != 0
ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["INDICATOR_RIGHT_FOUR"] != 0
else:
Expand Down
10 changes: 10 additions & 0 deletions opendbc/car/hyundai/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,16 @@
b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.06 99211-GI010 230110',
],
},
CAR.HYUNDAI_IONIQ_5_PE: {
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00NE__ RDR ----- 1.00 1.00 99110-PI000 ',
b'\xf1\x00NE__ RDR ----- 1.00 1.01 99110-GI500 '
],
(Ecu.fwdCamera, 0x7C4, None): [
b'\xf1\x00NE MFC AT USA LHD 1.00 1.01 99211-PI000 240905',
b'\xf1\x00NE MFC AT EUR LHD 1.00 1.03 99211-GI500 240809',
],
},
CAR.HYUNDAI_IONIQ_6: {
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00CE__ RDR ----- 1.00 1.01 99110-KL000 ',
Expand Down
4 changes: 2 additions & 2 deletions opendbc/car/hyundai/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime

if ret.flags & HyundaiFlags.CANFD_HDA2:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2
if ret.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2_ALT_STEERING
if ret.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2_ALT_STEERING
if ret.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_ALT_BUTTONS
if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC:
Expand Down
5 changes: 5 additions & 0 deletions opendbc/car/hyundai/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ class CAR(Platforms):
CarSpecs(mass=1948, wheelbase=2.97, steerRatio=14.26, tireStiffnessFactor=0.65),
flags=HyundaiFlags.EV,
)
HYUNDAI_IONIQ_5_PE = HyundaiCanFDPlatformConfig(
[HyundaiCarDocs("Hyundai Ioniq 5 PE (with HDA II) 2025+", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q]))],
HYUNDAI_IONIQ_5.specs,
flags=HyundaiFlags.EV | HyundaiFlags.ANGLE_CONTROL,
)
HYUNDAI_IONIQ_6 = HyundaiCanFDPlatformConfig(
[HyundaiCarDocs("Hyundai Ioniq 6 (with HDA II) 2023-24", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p]))],
HYUNDAI_IONIQ_5.specs,
Expand Down
1 change: 1 addition & 0 deletions opendbc/car/torque_data/override.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]

# Hyundai/Kia/Genesis angle control
"KIA_EV9" = [nan, 3.0, nan]
"HYUNDAI_IONIQ_5_PE" = [nan, 3.0, nan]

0 comments on commit 36efc3b

Please sign in to comment.