Skip to content

Commit

Permalink
mavplayback.py: explicit error if trying to replay a .BIN file
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Oct 25, 2024
1 parent 013ef26 commit 7dcbb0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/mavplayback.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import tkinter

from pymavlink import fgFDM
from pymavlink import DFReader

from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
Expand Down Expand Up @@ -57,6 +58,10 @@ def __init__(self, filename):

self.mlog = mavutil.mavlink_connection(filename, planner_format=args.planner,
robust_parsing=True)
if isinstance(self.mlog, DFReader.DFReader_binary):
print("mavplayback.py only works on .tlog files, not BIN ('dataflash') files")
sys.exit(1)

self.mout = []
for m in args.out:
self.mout.append(mavutil.mavlink_connection(m, input=False, baud=args.baudrate))
Expand Down

0 comments on commit 7dcbb0d

Please sign in to comment.