8000 Allow configurable maximum angle for AngleSteeringSafetyTest by bravochar · Pull Request #2231 · commaai/opendbc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow configurable maximum angle for AngleSteeringSafetyTest #2231

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bravochar
Copy link

The Subaru LKAS_ANGLE message is limited to a signed, 17-bit integer, which is more than enough for it's maximum steering of around 485 degrees (at least for my Ascent). However, the test_angle_cmd_when_enabled() defaults to twice the maximum steering angle, which will overflow this value and result in erroneously failed tests.

I have added a class variable, and logic that will default the test angle to twice the max angle value when it is not specifically configured. This keeps current behavior for existing tests, but will allow me to constraint he maximum test angle to the limits of my CAN bus messages. It's quite possible that other vehicles will be affected as more angle-based steering systems are supported, too.

@github-actions github-actions bot added the car safety vehicle-specific safety code label May 13, 2025
@bravochar
Copy link
Author

I need this for #2217

@adeebshihadeh
Copy link
Contributor

It's not clear this is the right fix... perhaps we should clip to the max in the CANPacker? That still doesn't fail explicitly though.

@bravochar
Copy link
Author

While it's possible that there is a better fix, I don't have the knowledge to identify or execute it. There are many other instances in these Python test where the code for the vehicles communicates limits and restrictions back to the base tests in common.py - STEER_ANGLE_MAX in this same class for example.

I definitely see the wisdom in there being a mechanism for the packer to throw some sort of exception or error, but I think that even that would just result in the fine tuning of test parameters for those cases where the CAN packer failed, like this one.

Another option might be to initiate that range of angles to something smaller then +/- 2*STEER_ANGLE_MAX. Something like the maximum steering angle plus twice the maximum adjustment up would allow for two tests beyond the safety boundary and not risk overflowing small values?

I'm really interested in getting something merged so I can remove my temporary fix from #2217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
car safety vehicle-specific safety code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0