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

Hyundai: match cancel button panda safety logic #34390

Merged
merged 4 commits into from
Jan 15, 2025
Merged

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jan 15, 2025

Closes #34203

This is to fix the problem where the logged button presses cause disengagement on pause/resume release with stock long. Still need a good way to support this with openpilot long, but that's lower priority as it doesn't jankily enable then disable in the first place, and long isn't in release

Stock long:

  • Pressing cancel (pause/resume) enables as normal, letting go does not cancel

openpilot long:

  • Pressing cancel is not considered an enable button and does not enable

This works by matching panda safety and not checking the cancel button when stock long is active, letting the radar handle both enabling and disabling.

@github-actions github-actions bot added the car vehicle-specific label Jan 15, 2025
selfdrive/car/car_specific.py Outdated Show resolved Hide resolved
@sshane sshane marked this pull request as draft January 15, 2025 05:07
Comment on lines 219 to 220
if b.type == ButtonType.cancel:
if b.type == ButtonType.cancel and (allow_button_cancel or not self.CP.pcmCruise):
events.add(EventName.buttonCancel)
Copy link
Contributor Author

@sshane sshane Jan 15, 2025

Choose a reason for hiding this comment

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

panda safety across the brands is quite split on checking the cancel button if stock long is controlling or not, and the way this previously worked was Hyundai-specific in not adding the button events, so this seems like a decent solution until we make all the panda safety match each other (don't check when stock long?)

GM, VW PQ, and Hyundai only check cancel button with op long, so this PR makes Hyundai match panda safety.

@sshane sshane changed the title Cancel on rising edge of cancel button Hyundai: match cancel button panda safety logic Jan 15, 2025
@sshane sshane marked this pull request as ready for review January 15, 2025 05:36
@sshane sshane merged commit 2258ea3 into master Jan 15, 2025
21 checks passed
@sshane sshane deleted the cancel-rising-edge branch January 15, 2025 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix car vehicle-specific hyundai
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hyundai: PCM and non-PCM longitudinal are not resuming with button press
1 participant