-
Notifications
You must be signed in to change notification settings - Fork 791
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
safety: add longitudinal pre-enable state for brake at a standstill #1123
base: master
Are you sure you want to change the base?
Conversation
board/safety.h
Outdated
@@ -85,7 +85,7 @@ int safety_fwd_hook(int bus_num, CANPacket_t *to_fwd) { | |||
} | |||
|
|||
bool get_longitudinal_allowed(void) { | |||
return controls_allowed && !gas_pressed_prev; | |||
return controls_allowed && !gas_pressed_prev && !brake_pressed_prev; |
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.
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.
return controls_allowed && !gas_pressed_prev; | ||
} | ||
|
||
bool get_accel_allowed(void) { |
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.
let's make this name less ambiguous, such as gas
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):