Skip to content

HKG: Add hands-on detection signal for LFA2 vehicles #2420

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

Merged
merged 1 commit into from
Jul 5, 2025

Conversation

devtekve
Copy link
Contributor

@devtekve devtekve commented Jun 28, 2025

This signal is for LFA2 vehicles that uses steering grip sensor. https://www.hyundaimotorgroup.com/innovation/CONT0000000000005027
image

image

Validation

  • Dongle ID: e1107f9d04dfb1e2
  • Route: e1107f9d04dfb1e2/0000025f--8df0049cd4

Note

The signal name is not 100% confirmed officially. This is because while I found found the signal on an official DBC, the message address was not the same as what I found, and neither was the structure completely. However, the values themselves mapped to what I found, so my only guess is that the signal simply got updated since the dbc I found.

Note

needed by: #1676

@jyoung8607 jyoung8607 changed the title signal: Add hands on detection signal for HKG LFA2 vehicles HKG: Add hands-on detection signal for LFA2 vehicles Jul 1, 2025
Copy link
Collaborator

@jyoung8607 jyoung8607 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message looks to have a usable COUNTER and cyclically-repeating CHECKSUM, which I'd presume uses one of the existing HKG checksum algorithms. Can you add those fields? Will merge once that's done.

@jyoung8607 jyoung8607 self-assigned this Jul 1, 2025
@devtekve
Copy link
Contributor Author

devtekve commented Jul 2, 2025

This message looks to have a usable COUNTER and cyclically-repeating CHECKSUM, which I'd presume uses one of the existing HKG checksum algorithms. Can you add those fields? Will merge once that's done.

@jyoung8607 this does not have COUNTER and I wasn't confident that the first 2 bytes are in fact CHECKSUM either because there was no mention of it on the official DBC (although like I said earlier, this is not 1:1 to the official message I found). That being said, I compared it with other messages of the same frequency and the CHECKSUM seems to be a perfectly good guess.

COUNTER is definitely not. What seems like it it's the HOD_Dir_Status but that's our grip level on the steering.

Screen.Recording.2025-07-02.at.9.28.17.AM.mov

Edit: Doing a "quick & dirty" search on the dbcs for canfd I don't see an instance where CHECKSUM exists but COUNTER does not, so I wouldn't like to define it and it meaning something else (even though it kinda points to be checksum)

@devtekve devtekve requested a review from jyoung8607 July 2, 2025 15:36
@jyoung8607
Copy link
Collaborator

From the very beginning of the route, with no motion and no hands-on/torque applied yet, the rest of the message beyond the counter and (assumed, unverified) checksum is invariant, so we can see the cyclic repetition on both. The counter is mod 0xF rather than mod 0x10 but I see that's done with some other HKG messages already.

I'll go ahead and merge this message as-is, so you'll have it for informational purposes, but I'd suggest adding CHECKSUM and COUNTER support before shipping a car port that makes active use of this detection.

Screenshot from 2025-07-05 16-19-57

cyclic-repeating

@jyoung8607 jyoung8607 merged commit cb17214 into commaai:master Jul 5, 2025
8 checks passed
@jyoung8607 jyoung8607 deleted the hkg-hod-canfd branch July 5, 2025 20:26
@devtekve
Copy link
Contributor Author

devtekve commented Jul 5, 2025

From the very beginning of the route, with no motion and no hands-on/torque applied yet, the rest of the message beyond the counter and (assumed, unverified) checksum is invariant, so we can see the cyclic repetition on both. The counter is mod 0xF rather than mod 0x10 but I see that's done with some other HKG messages already.

I'll go ahead and merge this message as-is, so you'll have it for informational purposes, but I'd suggest adding CHECKSUM and COUNTER support before shipping a car port that makes active use of this detection.

Screenshot from 2025-07-05 16-19-57

cyclic-repeating

Oh! Thank you for that insight, I was under the wrong assumption that the checksum was meant to be 2 bytes but clearly not. My comment for it not having counter was solely based on the fact that the 3rd byte was already identified properly, it never crossed my mind the 2nd byte would be having the counter!

ssysm pushed a commit to MOTIF-lab/opendbc that referenced this pull request Jul 9, 2025
Add hands on detection signal for LFA2 vehicles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants