Skip to content
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

Move safety code into opendbc #1579

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

Conversation

nworb-cire
Copy link
Contributor

@nworb-cire nworb-cire commented Dec 14, 2024

Still a bit WIP, will mark ready once I've fully validated the panda end. Still need to figure out the best way of moving the safety code tests into opendbc.

I did modify a couple of the safety files, diffs as follows:

# safety_hyundai.h
+   // forward cam to ccan and vice-versa, except lkas cmd
-   // forward cam to ccan and viceversa, except lkas cmd

to comply with codespell and

# safety_subaru_preglobal.h
+   const int SUBARU_PG_PARAM_REVERSED_DRIVER_TORQUE = 4;
-   const int SUBARU_PG_PARAM_REVERSED_DRIVER_TORQUE = 1;

to keep all of the Subaru panda flags in the same class.

Other changes include moving the UDS script into opendbc and the examples and panda_runner.py file out of opendbc. I moved them to openpilot, so expect a PR there once this is ready. Shouldn't be strictly necessary for basic functionality.

@adeebshihadeh
Copy link
Contributor

I did modify a couple of the safety files, diffs as follows:

Can you get any diff merged into panda first such that we can just mv panda/board/safety/ openpdbc_repo/opendbc/safety/? It's a ton easier to review that way.

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.

Thanks for picking this up. Happy to provide feedback as often as you'd like.

Per usual, it's best if we can break things up into small, self-contained PRs. In this case, I think we can start with the Python constants.

One tricky thing will be staying under opendbc's 1m CI timeout; I think we may have to compromise on that here and just fix it after merging. We'll likely have to do that to get test_models moved over here.

@@ -42,6 +42,11 @@ def __init__(self, CP):
pass


class FordPandaFlags(IntFlag):
Copy link
Contributor

Choose a reason for hiding this comment

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

this is something we should be able to split out and merge on its own

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 this deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants