-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Toyota TSS2: parse distance button #31722
Conversation
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
|
Thanks! @sshane will clean this up and get it merged as the first example, then the community can do the rest of the brands. |
selfdrive/car/toyota/carstate.py
Outdated
elif self.CP.flags & ToyotaFlags.SMART_DSU: | ||
self.distance_button = cp.vl["SDSU"]["FD_BUTTON"] == 1 | ||
# This may need some additional checks or can even simply be an "else" statement if all cars already have it mapped out | ||
elif self.CP.openpilotLongitudinalControl: | ||
self.distance_button = cp_acc.vl["ACC_CONTROL"]["DISTANCE"] == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we disable the radar on some TSS2 cars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that’s one of the additional checks I was thinking I’ll need to add in. I’ll keep that in mind when I go through and clean it up tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently the buttons are wired directly up to the camera. I blocked all messages that we normally forward through the panda to the camera and it still knew when we were pressing both the distance and lane keep button (but didn't know the wheel angle in STEERING_LTA
for example) :(
Looks like no button parsing for RAV4 2022+, as they are probably then connected to the radar there
Found the button on no other message unfortunately
Thanks! We can do SDSU in a follow up PR |
* Enable the distance button to switch personalities for Toyota/Lexus * Default to the "standard" personality for now * only parsing first * only parse * no personality in card * safe * comment --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
Needs some cleaning up, especially in regards to handling the parameters, but figured I'd write up a quick draft just to get something going and gather some official feedback from the comma team to see which direction y'all wanted to go. But this is the gist of controlling personalities via the "Distance" button on the steering wheel for Toyota/Lexus.
Not too sure if y'all want the extra function to restore the previous drive's personality, but I put that in there since it's certainly a very nice QOL change since it defaults to the "Relaxed" personality upon ignition.
I added a bunch of comments as I went to help clear up the "why", but feel free to ask any questions or provide any inputs or critiques and I'll be happy to accommodate!