forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebase all open branches on this commit to make sure they are tested correctly!
- Loading branch information
1 parent
2a093a3
commit e1c34a1
Showing
12 changed files
with
404 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import time | ||
from panda_jungle import PandaJungle # pylint: disable=import-error | ||
from .helpers import panda_jungle, reset_pandas, test_all_pandas, test_all_gen2_pandas, panda_connect_and_init | ||
|
||
# Reset the pandas before running tests | ||
def aaaa_reset_before_tests(): | ||
reset_pandas() | ||
|
||
@test_all_pandas | ||
@panda_connect_and_init | ||
def test_ignition(p): | ||
try: | ||
# Set harness orientation to #2, since the ignition line is on the wrong SBU bus :/ | ||
panda_jungle.set_harness_orientation(PandaJungle.HARNESS_ORIENTATION_2) | ||
reset_pandas() | ||
p.reconnect() | ||
panda_jungle.set_ignition(False) | ||
time.sleep(2) | ||
assert p.health()['ignition_line'] == False | ||
panda_jungle.set_ignition(True) | ||
time.sleep(2) | ||
assert p.health()['ignition_line'] == True | ||
finally: | ||
panda_jungle.set_harness_orientation(PandaJungle.HARNESS_ORIENTATION_1) | ||
|
||
@test_all_gen2_pandas | ||
@panda_connect_and_init | ||
def test_orientation_detection(p): | ||
seen_orientations = [] | ||
for i in range(3): | ||
panda_jungle.set_harness_orientation(i) | ||
reset_pandas() | ||
p.reconnect() | ||
detected_harness_orientation = p.health()['car_harness_status'] | ||
if (i == 0 and detected_harness_orientation != 0) or detected_harness_orientation in seen_orientations: | ||
assert False | ||
seen_orientations.append(detected_harness_orientation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.