8000 safety: split longitudinal and lateral checks by sshane · Pull Request #2297 · commaai/opendbc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

safety: split longitudinal and lateral checks #2297

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sshane
Copy link
Contributor
@sshane sshane commented May 24, 2025

Everything else stays in safety.h

Need to move common functions like interpolate either into safety_declarations.h or a new file (I added safety_helpers.h for now), might as well move everything? If so, then can main.c and safety.h be the same thing?

@github-actions github-actions bot added the car safety vehicle-specific safety code label May 24, 2025
@sshane
Copy link
Contributor Author
sshane commented May 24, 2025

@adeebshihadeh did you have any specific ideas about this or want me to explore it further?

@sshane sshane marked this pull request as draft May 24, 2025 05:41
Copy link
Contributor
@adeebshihadeh adeebshihadeh left a comment

Choose a reason for hiding this comment

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

LGTM aside from comments

Comment on lines +4 to +6
#include "opendbc/safety/safety_helpers.h"
#include "opendbc/safety/safety_lateral.h"
#include "opendbc/safety/safety_longitudinal.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for the safety_ prefix - the folder is already called safety!

Copy link
Contributor

Choose a reason for hiding this comment

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

helpers doesn't fully capture what's in this file. interpolate is a helper, generic_rx_checks implements safety

steering_disengage_prev = steering_disengage;
}

static void stock_ecu_check(bool stock_ecu_detected) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd just put these non-helper functions back in safety.h for now

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