pymavlink icon indicating copy to clipboard operation
pymavlink copied to clipboard

mavplayback fails playing back .BIN file

Open swilliam opened this issue 1 year ago • 1 comments

mavplayback.py playing back a .BIN log file

$ mavplayback.py 00000038.BIN
Traceback (most recent call last):
  File "~/bin/mavplayback.py", line 256, in <module>
    app=App(filename)
  File "~/bin/mavplayback.py", line 104, in __init__
    self.next_message()
  File "~/bin/mavplayback.py", line 199, in next_message
    pos = float(self.mlog.f.tell()) / self.filesize
AttributeError: 'DFReader_binary' object has no attribute 'f'

mavplayback.py uses DFReader_binary class from DFReader.py to load .BIN file, but that class has no f attribute instead it uses filehandle

playback of .tlog files works

swilliam avatar Aug 09 '24 02:08 swilliam

I have the same problem. I replaced f with filehandle and it doesn't throw the error, but it seems to be sending invalid mavlink messages in the out port.

gamoreno avatar Aug 30 '24 15:08 gamoreno

mavplayback only works with .tlog files - it only looks for mavlink messages, doesn't attempt to extract data from any other log type.

We should probably check the type returned by the connection and give a reasonable error message: https://github.com/ArduPilot/pymavlink/pull/985

peterbarker avatar Oct 02 '24 01:10 peterbarker