8000 Tesla: move safety out of debug by sshane · Pull Request #2285 · commaai/opendbc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tesla: move safety out of debug #2285

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 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opendbc/safety/modes/tesla.h
Copy link
Contributor

Choose a reason for hiding this comment

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

let's move RAD_TO_DEG, ISO_LATERAL_ACCEL, and anything else like EARTH out of here

Copy link
Contributor

Choose a reason for hiding this comment

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

let's put our jerk limit in the constants file too and leave a comment that it's lower than ISO

Copy link
Contributor

Choose a reason for hiding this comment

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

why is there a check for limits.inactive_angle_is_zero? should be constant within a safety mode

Copy link
Contributor

Choose a reason for hiding this comment

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

standardize on chksum or checksum

Copy link
Contributor

Choose a reason for hiding this comment

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

was TESLA_MAX_SPEED_DELTA verified with data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why is there a check for limits.inactive_angle_is_zero? should be constant within a safety mode

It was copied from the standard angle check function, the plan was to combine the two functions. But I think we should refactor the current angle function before doing that as it's way too big

Copy link
Contributor Author
@sshane sshane May 24, 2025

Choose a reason for hiding this comment

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

for brake press, IBST_driverBrakeApply has a fault state we should check

Usually, quality flags describe the signal they protect (ESP_wheelSpeedsQF). That's a generic iBooster status that may or may not be relevant to driver brake press.

Edit: Ah, I see IBST_driverBrakeApply=FAULT #2292

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pull out the invalid speed check, nothing in modes/ should touch controls_allowed. these files are just parsers.

#2294

8000
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tesla_steer_angle_cmd_checks should be moved. again this file should essentially be a parser

#2298

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved some constants: #2300

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "opendbc/safety/safety_declarations.h"


// parameters for lateral accel/jerk angle limiting using a simple vehicle model
typedef struct {
const float slip_factor;
Expand Down
2 changes: 1 addition & 1 deletion opendbc/safety/safety.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ int set_safety_hooks(uint16_t mode, uint16_t param) {
{SAFETY_BODY, &body_hooks},
{SAFETY_FORD, &ford_hooks},
{SAFETY_RIVIAN, &rivian_hooks},
{SAFETY_TESLA, &tesla_hooks},
#ifdef CANFD
{SAFETY_HYUNDAI_CANFD, &hyundai_canfd_hooks},
#endif
#ifdef ALLOW_DEBUG
{SAFETY_TESLA, &tesla_hooks},
{SAFETY_SUBARU_PREGLOBAL, &subaru_preglobal_hooks},
{SAFETY_VOLKSWAGEN_PQ, &volkswagen_pq_hooks},
{SAFETY_ALLOUTPUT, &alloutput_hooks},
Expand Down
0