commaai / openpilot

openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system in 275+ supported cars.
https://comma.ai/openpilot
MIT License
49.72k stars 9.05k forks source link

Match stock Hyundai button logic #30950

Open sshane opened 9 months ago

sshane commented 9 months ago

Currently we diverge from the original behavior when openpilot (alpha) longitudinal is used, which has confused some users in the past having them ask on Discord how to engage.

We should match the stock longitudinal button logic in panda and openpilot, here's what we don't match:

This needs to be done for both Hyundai's CAN and CAN FD platforms.

BBBmau commented 7 months ago

Looking to work on this to get a good understanding of how the engaging works.

This needs to be done for both Hyundai's CAN and CAN FD platforms.; if both CAN /CAN FD platforms are needed in hyundai, why are we wanting to match it to the hyundai button logic if that logic also needs to be replaced?

Been looking over it and it seems to make sense how disengaging and engaging works but that one part is what puzzles me.

BBBmau commented 7 months ago

found what I was looking for, after looking through car_controller.py in /hyundai I saw that the stock hyundai logic is just def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool): that's created in that same file.

I'll create a draft PR once I feel confident with one car and move on to others. I look forward to your comments on it! 👍🏼