Skip to content

Commit

Permalink
use whole route when running safety replay from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed May 31, 2020
1 parent 098f47a commit 3a85f4c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/safety_replay/replay_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from panda.tests.safety import libpandasafety_py
from panda.tests.safety_replay.helpers import package_can_msg, init_segment
from tools.lib.logreader import LogReader # pylint: disable=import-error

# replay a drive to check for safety violations
def replay_drive(lr, safety_mode, param):
Expand Down Expand Up @@ -65,9 +64,13 @@ def replay_drive(lr, safety_mode, param):
return tx_controls_blocked == 0 and rx_invalid == 0

if __name__ == "__main__":
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator # pylint: disable=import-error

mode = int(sys.argv[2])
param = 0 if len(sys.argv) < 4 else int(sys.argv[3])
lr = LogReader(sys.argv[1])
r = Route(sys.argv[1])
lr = MultiLogIterator(r.log_paths(), wraparound=False)

print("replaying drive %s with safety mode %d and param %d" % (sys.argv[1], mode, param))

Expand Down

0 comments on commit 3a85f4c

Please sign in to comment.