Skip to content

safety: add longitudinal pre-enable state for brake at a standstill#1123

Closed
sshane wants to merge 37 commits intomasterfrom
brake-preenable
Closed

safety: add longitudinal pre-enable state for brake at a standstill#1123
sshane wants to merge 37 commits intomasterfrom
brake-preenable

Conversation

@sshane
Copy link
Copy Markdown
Contributor

@sshane sshane commented Oct 28, 2022

Adds new pre-enable state when enabling at a standstill with brake depressed. Allows brake and negative accel to 0 accel, blocks positive accel, gas, interceptor.

Pre-reqs (so this change isn't unmaintainable):

board/safety.h Outdated

bool get_longitudinal_allowed(void) {
return controls_allowed && !gas_pressed_prev;
return controls_allowed && !gas_pressed_prev && !brake_pressed_prev;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will need to allow braking on cars that are gas/brake controlled and not acceleration controlled.

On both GM and certain Honda, once you release the brake the car will lurch forward as openpilot's brake request ramps up.

@sshane sshane changed the title safety: add brake pre-enable state safety: add longitudinal pre-enable state for brake at a standstill Oct 28, 2022
@sshane sshane marked this pull request as draft October 28, 2022 06:24
@sshane sshane added the car safety vehicle-specific safety code label Oct 4, 2023
@sshane sshane requested a review from adeebshihadeh November 11, 2023 08:22
@sshane sshane marked this pull request as ready for review November 11, 2023 08:22
return controls_allowed && !gas_pressed_prev;
}

bool get_accel_allowed(void) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's make this name less ambiguous, such as gas

@sshane
Copy link
Copy Markdown
Contributor Author

sshane commented Feb 20, 2025

We've moved the car safety code into opendbc, please rebase and re-open your PR there!

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