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

Safety: assert that we use the steering req bit #1625

Merged
merged 15 commits into from
Sep 13, 2023
Merged

Conversation

jnewb1
Copy link
Contributor

@jnewb1 jnewb1 commented Aug 31, 2023

TODO:

  • verify all of these and split into PR for each
  • VW needs to control this bit for fault avoidance, any others?

#1621

@jnewb1
Copy link
Contributor Author

jnewb1 commented Aug 31, 2023

just missing vw now

@jnewb1 jnewb1 added car safety vehicle-specific safety code tests labels Sep 1, 2023
@jnewb1 jnewb1 marked this pull request as ready for review September 1, 2023 04:59
@jnewb1 jnewb1 requested a review from sshane September 11, 2023 21:13
@sshane
Copy link
Contributor

sshane commented Sep 13, 2023

example failure catching a safety mode not setting steer_req

======================================================================
FAIL: test_steer_req_bit (__main__.TestGmCameraSafety.test_steer_req_bit)
Asserts all torque safety modes check the steering request bit
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/batman/openpilot/panda/tests/safety/common.py", line 300, in test_steer_req_bit
    self.assertFalse(self._tx(self._torque_cmd_msg(self.MAX_TORQUE, 0)))
AssertionError: 1 is not false

@sshane
Copy link
Contributor

sshane commented Sep 13, 2023

Changed the test to not modify the safety code. It's better not to add a variable that's not used anywhere in the safety, it's more prone to bugs (was missing from the init/reset function).

tests/safety/common.py Outdated Show resolved Hide resolved
@sshane sshane linked an issue Sep 13, 2023 that may be closed by this pull request
8 tasks
@sshane sshane merged commit 90eb24b into master Sep 13, 2023
@sshane sshane deleted the test-steer-bits branch September 13, 2023 08:08
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 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

safety tests: check steer request bit for all cars
2 participants