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 Hyundai Palisade and Kia Telluride 2023-24 (non-HDA2) #27478

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d634ddf
HKG: Car Port for Hyundai Palisade 2023 and Kia Telluride 2023 (non-H…
sunnyhaibin Mar 2, 2023
4356862
don't forget dbc
sunnyhaibin Mar 2, 2023
95bee73
Don't forward
sunnyhaibin Mar 2, 2023
19bd540
Revert "Don't forward"
sunnyhaibin Mar 2, 2023
0eda669
try not modifying checksum
sunnyhaibin Mar 2, 2023
0f7c065
forward counters
sunnyhaibin Mar 2, 2023
c98ba3c
try this?
sunnyhaibin Mar 3, 2023
640786d
fill it up
sunnyhaibin Mar 3, 2023
8115513
limit it
sunnyhaibin Mar 3, 2023
dcd952f
bump opendbc
sunnyhaibin Mar 3, 2023
faa6c42
try this out
sunnyhaibin Mar 3, 2023
fc3678b
bump opendbc
sunnyhaibin Mar 3, 2023
b5016f7
pass through everything from cs
sunnyhaibin Mar 3, 2023
7abebcf
don't use
sunnyhaibin Mar 3, 2023
a2a651f
only modify these
sunnyhaibin Mar 3, 2023
ca9bad0
wait, we weren't sending this?!
sunnyhaibin Mar 3, 2023
5722959
Send LFA on this one too!
sunnyhaibin Mar 3, 2023
71b51c7
bump opendbc
sunnyhaibin Mar 3, 2023
fdac94b
bump panda
sunnyhaibin Mar 3, 2023
7521b9c
pass through LFAHDA_MPC and some modified
sunnyhaibin Mar 3, 2023
a16ad58
try sending these values now
sunnyhaibin Mar 3, 2023
dc62540
don't send this
sunnyhaibin Mar 3, 2023
aeeb9b9
stop changing
sunnyhaibin Mar 3, 2023
a99f8b4
try sending checksum and counter this way
sunnyhaibin Mar 3, 2023
ede8075
some cleanup
sunnyhaibin Mar 3, 2023
4d88dbd
more cleanup
sunnyhaibin Mar 3, 2023
38e5bdd
6b checksum
sunnyhaibin Mar 4, 2023
c9a0208
should be byte 1-7
sunnyhaibin Mar 4, 2023
eb35f6c
try this checksum
sunnyhaibin Mar 4, 2023
c97875a
hmm
sunnyhaibin Mar 4, 2023
78a79a7
try the old one
sunnyhaibin Mar 4, 2023
3644a3c
suppress cluster error
sunnyhaibin Mar 4, 2023
a6d087c
bump opendbc
sunnyhaibin Mar 4, 2023
a7f17ce
match stock
sunnyhaibin Mar 4, 2023
549f51e
small cleanup
sunnyhaibin Mar 4, 2023
0ae5ac4
lower delta up/down
sunnyhaibin Mar 4, 2023
44f141a
some cleanup
sunnyhaibin Mar 4, 2023
01ed053
add test route
sunnyhaibin Mar 4, 2023
5dd3927
merge rx checks
sunnyhaibin Mar 4, 2023
cf86db4
bump panda
sunnyhaibin Mar 4, 2023
f211b32
Merge remote-tracking branch 'upstream/master' into palisade-2023-port-2
sunnyhaibin Mar 4, 2023
71e151c
fix understeer
sunnyhaibin Mar 6, 2023
c9fb5e5
Revert "fix understeer"
sunnyhaibin Mar 6, 2023
ab8b5b4
less oversteer
sunnyhaibin Mar 6, 2023
db3c22f
bump opendbc
sunnyhaibin Mar 6, 2023
45538cb
lower friction to test torqued
sunnyhaibin Mar 8, 2023
08f6958
default values worked best
sunnyhaibin Mar 8, 2023
61000d9
Revert "default values worked best"
sunnyhaibin Mar 8, 2023
6ae76fe
higher factor at init
sunnyhaibin Mar 8, 2023
21743b1
add more FW
sunnyhaibin Mar 12, 2023
208e780
Revert "add more FW"
sunnyhaibin Mar 12, 2023
4f0ac09
add more FW (mbbarnestn)
sunnyhaibin Mar 18, 2023
da0ed5e
Merge remote-tracking branch 'upstream/master' into palisade-2023-port-2
sunnyhaibin Mar 27, 2023
ca843fa
bump opendbc
sunnyhaibin Mar 27, 2023
d3f0ec4
bump panda
sunnyhaibin Mar 27, 2023
cdb227b
Merge branch 'upstream/openpilot/master' into palisade-2023-port-2
sunnyhaibin Jun 4, 2023
8aa2fa6
fix
sunnyhaibin Aug 11, 2023
5241883
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 11, 2023
ac4f430
Update CARS.md
sunnyhaibin Aug 11, 2023
6e944e6
Fix
sunnyhaibin Aug 11, 2023
5fd43d1
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 18, 2023
a887df0
Sync with CanBus helper
sunnyhaibin Aug 25, 2023
6e72d77
bump opendbc
sunnyhaibin Aug 25, 2023
8c20f19
Use generated DBC for common messages
sunnyhaibin Aug 27, 2023
ef63743
bump opendbc
sunnyhaibin Aug 27, 2023
ac208d7
bump opendbc
sunnyhaibin Aug 27, 2023
d776505
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 27, 2023
3b5d63a
Cleanup and fixes
sunnyhaibin Aug 27, 2023
cf1ae51
Should be here
sunnyhaibin Aug 27, 2023
aca2330
consolidate in method
sunnyhaibin Aug 27, 2023
5a34070
Gate the list
sunnyhaibin Aug 27, 2023
ee34c6e
Gate it by default
sunnyhaibin Aug 27, 2023
f324df0
Update docs
sunnyhaibin Aug 27, 2023
51781a2
Revert for now
sunnyhaibin Aug 28, 2023
3abafb0
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 28, 2023
c38ac76
bump opendbc
sunnyhaibin Aug 28, 2023
0cf6c5f
Fix button method
sunnyhaibin Aug 29, 2023
64cb137
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 29, 2023
5cbeeed
try this
sunnyhaibin Aug 29, 2023
d2bad37
flipped safety mode :p
sunnyhaibin Aug 29, 2023
9c16023
H7 reset
sunnyhaibin Aug 29, 2023
2ee2bf0
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 30, 2023
54e5f13
This platform is radar SCC
sunnyhaibin Aug 30, 2023
2384a52
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Aug 30, 2023
c0955a2
fix
sunnyhaibin Aug 30, 2023
e14c5ba
bump safety param
sunnyhaibin Aug 31, 2023
61a8219
Merge remote-tracking branch 'upstream/master' into palisade-2023-port-2
sshane Sep 7, 2023
f1aebe5
lower lateral limits
sshane Sep 7, 2023
e5c6e22
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Nov 16, 2023
ab0a211
fix checksum arg
sunnyhaibin Nov 16, 2023
b8074cf
remove unused
sunnyhaibin Nov 16, 2023
a0d1d04
sync dbc with generator
sunnyhaibin Nov 16, 2023
1792e9a
Add more FW versions
sunnyhaibin Feb 8, 2024
ff6f687
Merge remote-tracking branch 'commaai/openpilot/master' into palisade…
sunnyhaibin Jun 17, 2024
c596a50
Missed
sunnyhaibin Jun 17, 2024
c311b6c
Update docs
sunnyhaibin Jun 17, 2024
0f66f91
Update RELEASES.md
sunnyhaibin Jun 17, 2024
ae15252
Add back fingerprints from sync
sunnyhaibin Jun 17, 2024
6b8daf4
Fix typo
sunnyhaibin Jun 17, 2024
d54f695
More
sunnyhaibin Jun 17, 2024
a49d4b9
Driver torque mismatch fix
sunnyhaibin Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Version 0.9.8 (2024-XX-XX)
========================
* Added toggle to enable driver monitoring even when openpilot is not engaged
* Hyundai Palisade (without HDA II) 2023-24 support thanks to sunnyhaibin!
* Kia Telluride (without HDA II) 2023-24 support thanks to sunnyhaibin!

Version 0.9.7 (2024-06-13)
========================
Expand Down Expand Up @@ -50,9 +52,11 @@ Version 0.9.5 (2023-11-17)
* Hyundai Custin 2023 support thanks to sunnyhaibin and Saber422!
* Hyundai Ioniq 6 2023 support thanks to sunnyhaibin and alamo3!
* Hyundai Kona Electric 2023 (Korean version) support thanks to sunnyhaibin and haram-KONA!
* Hyundai Palisade (without HDA II) 2023 support thanks to sunnyhaibin!
* Kia K8 Hybrid (with HDA II) 2023 support thanks to sunnyhaibin!
* Kia Optima Hybrid 2019 support
* Kia Sorento Hybrid 2023 support thanks to sunnyhaibin!
* Kia Telluride (without HDA II) 2023 support thanks to sunnyhaibin!
* Lexus GS F 2016 support thanks to snyperifle!
* Lexus IS 2023 support thanks to L3R5!

Expand Down
4 changes: 3 additions & 1 deletion docs/CARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A supported vehicle is one that just works when you install a comma device. All supported cars provide a better experience than any stock system. Supported vehicles reference the US market unless otherwise specified.

# 288 Supported Cars
# 290 Supported Cars

|Make|Model|Supported Package|ACC|No ACC accel below|No ALC below|Steering Torque|Resume from stop|<a href="##"><img width=2000></a>Hardware Needed<br>&nbsp;|Video|
|---|---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
Expand Down Expand Up @@ -106,6 +106,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Hyundai|Kona Electric (with HDA II, Korea only) 2023[<sup>5</sup>](#footnotes)|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai R connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Kona Electric (with HDA II, Korea only) 2023">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=U2fOCmcQ8hw" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai I connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Kona Hybrid 2020">Buy Here</a></sub></details>||
|Hyundai|Palisade 2020-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Palisade 2020-22">Buy Here</a></sub></details>|<a href="https://youtu.be/TAnDqjF4fDY?t=456" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Hyundai|Palisade (without HDA II) 2023-24[<sup>5</sup>](#footnotes)|Highway Driving Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai A connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Palisade (without HDA II) 2023-24">Buy Here</a></sub></details>||
|Hyundai|Santa Cruz 2022-24[<sup>5</sup>](#footnotes)|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai N connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Santa Cruz 2022-24">Buy Here</a></sub></details>||
|Hyundai|Santa Fe 2019-20|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai D connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Santa Fe 2019-20">Buy Here</a></sub></details>|<a href="https://youtu.be/bjDR0YjM__s" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Hyundai|Santa Fe 2021-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Hyundai&model=Santa Fe 2021-23">Buy Here</a></sub></details>|<a href="https://youtu.be/VnHzSTygTS4" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
Expand Down Expand Up @@ -162,6 +163,7 @@ A supported vehicle is one that just works when you install a comma device. All
|Kia|Stinger 2018-20|Smart Cruise Control (SCC)|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai C connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Kia&model=Stinger 2018-20">Buy Here</a></sub></details>|<a href="https://www.youtube.com/watch?v=MJ94qoofYw0" target="_blank"><img height="18px" src="assets/icon-youtube.svg"></img></a>|
|Kia|Stinger 2022-23|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai K connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Kia&model=Stinger 2022-23">Buy Here</a></sub></details>||
|Kia|Telluride 2020-22|All|openpilot available[<sup>1</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai H connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Kia&model=Telluride 2020-22">Buy Here</a></sub></details>||
|Kia|Telluride (without HDA II) 2023-24[<sup>5</sup>](#footnotes)|Highway Driving Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 Hyundai L connector<br>- 1 RJ45 cable (7 ft)<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Kia&model=Telluride (without HDA II) 2023-24">Buy Here</a></sub></details>||
|Lexus|CT Hybrid 2017-18|Lexus Safety System+|openpilot available[<sup>2</sup>](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=CT Hybrid 2017-18">Buy Here</a></sub></details>||
|Lexus|ES 2017-18|All|openpilot available[<sup>2</sup>](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES 2017-18">Buy Here</a></sub></details>||
|Lexus|ES 2019-24|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|<details><summary>Parts</summary><sub>- 1 RJ45 cable (7 ft)<br>- 1 Toyota A connector<br>- 1 comma 3X<br>- 1 comma power v2<br>- 1 harness box<br>- 1 mount<br>- 1 right angle OBD-C cable (1.5 ft)<br><a href="https://comma.ai/shop/comma-3x.html?make=Lexus&model=ES 2019-24">Buy Here</a></sub></details>||
Expand Down
2 changes: 1 addition & 1 deletion panda
10 changes: 6 additions & 4 deletions selfdrive/car/hyundai/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from openpilot.selfdrive.car import apply_driver_steer_torque_limits, common_fault_avoidance
from openpilot.selfdrive.car.hyundai import hyundaicanfd, hyundaican
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR, CAN_CANFD_HYBRID_CAR
from openpilot.selfdrive.car.interfaces import CarControllerBase

VisualAlert = car.CarControl.HUDControl.VisualAlert
Expand Down Expand Up @@ -103,9 +103,11 @@ def update(self, CC, CS, now_nanos):
if self.CP.flags & HyundaiFlags.ENABLE_BLINKERS:
can_sends.append([0x7b1, 0, b"\x02\x3E\x80\x00\x00\x00\x00\x00", self.CAN.ECAN])

hda2 = self.CP.flags & HyundaiFlags.CANFD_HDA2
hda2_can_canfd_hybrid = hda2 and self.CP.flags & HyundaiFlags.CAN_CANFD_HYBRID

# CAN-FD platforms
if self.CP.carFingerprint in CANFD_CAR:
hda2 = self.CP.flags & HyundaiFlags.CANFD_HDA2
if self.CP.carFingerprint in CANFD_CAR and (self.CP.carFingerprint not in CAN_CANFD_HYBRID_CAR or hda2_can_canfd_hybrid):
hda2_long = hda2 and self.CP.openpilotLongitudinalControl

# steering control
Expand Down Expand Up @@ -153,7 +155,7 @@ def update(self, CC, CS, now_nanos):

# 20 Hz LFA MFA message
if self.frame % 5 == 0 and self.CP.flags & HyundaiFlags.SEND_LFA.value:
can_sends.append(hyundaican.create_lfahda_mfc(self.packer, CC.enabled))
can_sends.append(hyundaican.create_lfahda_mfc(self.packer, self.frame, CC.enabled, self.CP))

# 5 Hz ACC options
if self.frame % 20 == 0 and self.CP.openpilotLongitudinalControl:
Expand Down
51 changes: 30 additions & 21 deletions selfdrive/car/hyundai/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from opendbc.can.can_define import CANDefine
from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CAN_GEARS, CAMERA_SCC_CAR, \
CANFD_CAR, Buttons, CarControllerParams
CANFD_CAR, Buttons, CarControllerParams, CAN_CANFD_HYBRID_CAR
from openpilot.selfdrive.car.interfaces import CarStateBase

PREV_BUTTON_SAMPLES = 8
Expand All @@ -27,7 +27,7 @@ def __init__(self, CP):
self.gear_msg_canfd = "GEAR_ALT" if CP.flags & HyundaiFlags.CANFD_ALT_GEARS else \
"GEAR_ALT_2" if CP.flags & HyundaiFlags.CANFD_ALT_GEARS_2 else \
"GEAR_SHIFTER"
if CP.carFingerprint in CANFD_CAR:
if CP.carFingerprint in (CANFD_CAR - CAN_CANFD_HYBRID_CAR):
self.shifter_values = can_define.dv[self.gear_msg_canfd]["GEAR"]
elif self.CP.carFingerprint in CAN_GEARS["use_cluster_gears"]:
self.shifter_values = can_define.dv["CLU15"]["CF_Clu_Gear"]
Expand All @@ -53,7 +53,7 @@ def __init__(self, CP):
self.params = CarControllerParams(CP)

def update(self, cp, cp_cam):
if self.CP.carFingerprint in CANFD_CAR:
if self.CP.carFingerprint in (CANFD_CAR - CAN_CANFD_HYBRID_CAR):
return self.update_canfd(cp, cp_cam)

ret = car.CarState.new_message()
Expand Down Expand Up @@ -107,11 +107,12 @@ def update(self, cp, cp_cam):
ret.cruiseState.standstill = False
ret.cruiseState.nonAdaptive = False
else:
ret.cruiseState.available = cp_cruise.vl["SCC11"]["MainMode_ACC"] == 1
scc_bus = "SCC12" if self.CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value else "SCC11"
ret.cruiseState.available = cp_cruise.vl[scc_bus]["MainMode_ACC"] == 1
ret.cruiseState.enabled = cp_cruise.vl["SCC12"]["ACCMode"] != 0
ret.cruiseState.standstill = cp_cruise.vl["SCC11"]["SCCInfoDisplay"] == 4.
ret.cruiseState.nonAdaptive = cp_cruise.vl["SCC11"]["SCCInfoDisplay"] == 2. # Shows 'Cruise Control' on dash
ret.cruiseState.speed = cp_cruise.vl["SCC11"]["VSetDis"] * speed_conv
ret.cruiseState.standstill = cp_cruise.vl[scc_bus]["SCCInfoDisplay"] == 4.
ret.cruiseState.nonAdaptive = cp_cruise.vl[scc_bus]["SCCInfoDisplay"] == 2. # Shows 'Cruise Control' on dash
ret.cruiseState.speed = cp_cruise.vl[scc_bus]["VSetDis"] * speed_conv

# TODO: Find brake pressure
ret.brake = 0
Expand Down Expand Up @@ -144,7 +145,7 @@ def update(self, cp, cp_cam):

ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear))

if not self.CP.openpilotLongitudinalControl:
if not self.CP.openpilotLongitudinalControl and not (self.CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value):
aeb_src = "FCA11" if self.CP.flags & HyundaiFlags.USE_FCA.value else "SCC12"
aeb_sig = "FCA_CmdAct" if self.CP.flags & HyundaiFlags.USE_FCA.value else "AEB_CmdAct"
aeb_warning = cp_cruise.vl[aeb_src]["CF_VSM_Warn"] != 0
Expand Down Expand Up @@ -250,12 +251,14 @@ def update_canfd(self, cp, cp_cam):
return ret

def get_can_parser(self, CP):
if CP.carFingerprint in CANFD_CAR:
if CP.carFingerprint in (CANFD_CAR - CAN_CANFD_HYBRID_CAR):
return self.get_can_parser_canfd(CP)

freq_mdps12 = 100 if CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value else 50

messages = [
# address, frequency
("MDPS12", 50),
("MDPS12", freq_mdps12),
("TCS11", 100),
("TCS13", 50),
("TCS15", 10),
Expand All @@ -269,16 +272,20 @@ def get_can_parser(self, CP):
("SAS11", 100),
]

if not CP.openpilotLongitudinalControl and CP.carFingerprint not in CAMERA_SCC_CAR:
messages += [
("SCC11", 50),
("SCC12", 50),
]
if CP.flags & HyundaiFlags.USE_FCA.value:
messages.append(("FCA11", 50))
if not CP.openpilotLongitudinalControl:
if CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value:
messages.append(("SCC12", 50))
elif CP.carFingerprint not in CAMERA_SCC_CAR:
messages += [
("SCC11", 50),
("SCC12", 50),
]
if CP.flags & HyundaiFlags.USE_FCA.value:
messages.append(("FCA11", 50))

if CP.enableBsm:
messages.append(("LCA11", 50))
freq_lca11 = 20 if CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value else 50
messages.append(("LCA11", freq_lca11))

if CP.flags & (HyundaiFlags.HYBRID | HyundaiFlags.EV):
messages.append(("E_EMS11", 50))
Expand All @@ -297,11 +304,12 @@ def get_can_parser(self, CP):
else:
messages.append(("LVR12", 100))

return CANParser(DBC[CP.carFingerprint]["pt"], messages, 0)
bus = CanBus(CP).ECAN if CP.flags & HyundaiFlags.CAN_CANFD_HYBRID.value else 0
return CANParser(DBC[CP.carFingerprint]["pt"], messages, bus)

@staticmethod
def get_cam_can_parser(CP):
if CP.carFingerprint in CANFD_CAR:
if CP.carFingerprint in (CANFD_CAR - CAN_CANFD_HYBRID_CAR):
return CarState.get_cam_can_parser_canfd(CP)

messages = [
Expand All @@ -317,7 +325,8 @@ def get_cam_can_parser(CP):
if CP.flags & HyundaiFlags.USE_FCA.value:
messages.append(("FCA11", 50))

return CANParser(DBC[CP.carFingerprint]["pt"], messages, 2)
bus = CanBus(CP).CAM if CP.flags & HyundaiFlags.CAN_CANFD_HYBRID else 2
return CANParser(DBC[CP.carFingerprint]["pt"], messages, bus)

def get_can_parser_canfd(self, CP):
messages = [
Expand Down
15 changes: 15 additions & 0 deletions selfdrive/car/hyundai/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,21 @@
b'\xf1\x00ON MFC AT USA LHD 1.00 1.04 99211-S9100 211227',
],
},
CAR.HYUNDAI_PALISADE_2023: {
(Ecu.fwdCamera, 0x7c4, None): [
b'\xf1\x00LX2 MFC AT USA LHD 1.00 1.04 99211-S8150 220622',
b'\xf1\x00ON MFC AT USA LHD 1.00 1.01 99211-S9150 220708',
b'\xf1\x00ON MFC AT USA LHD 1.00 1.00 99211-S9160 230303',
b'\xf1\x00ON MFC AT USA LHD 1.00 1.01 99211-S9160 230802',
],
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00LX2_ SCC ----- 1.00 1.01 99110-S8150 ',
b'\xf1\x00ON__ SCC ----- 1.00 1.01 99110-S9150 ',
b'\xf1\x00LX2_ SCC FHCUP 1.00 1.01 99110-S8150 ',
b'\xf1\x00ON__ SCC FHCUP 1.00 1.01 99110-S9150 ',
b'\xf1\x00ON__ SCC FHCUP 1.00 1.00 99110-S9160 ',
],
},
CAR.HYUNDAI_VELOSTER: {
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00JS__ SCC H-CUP 1.00 1.02 95650-J3200 ',
Expand Down
Loading
Loading