Matlab conversion issues: MSG = 0 and \r\n on final _label

I’ve noticed 2 issues with MissionPlanner MATLAB conversion:

  1. All MSG log messages are 0.
    (I see that the data is a character string, but the MATLAB equivalent seems to be a double… so likely this type of message will need to be handled differently than numerical log messages.)
  2. On each *_label cell-array, the last entry appears to have additional characters appended, the carriage-return and line-feed. Or in printf-syntax: ‘\r\n’ (ASCII 13, ASCII 10)

If these are bugs, I wanted to report them. Thank you for the great software!
-Hunter

@hunt0r ive fixed the \r\n issue.

the string issue is harder to fix, because at the moment I only export double arrays.
not Cell arrays.

how important are strings in your opinion?

In case you are willing to take a (long) detour, you can try this (very alpha) MATLAB tool I have written: Mavlink-inspector: MATLAB DataFlash and MAVLink log diagnostics for fixed-wing airplanes

There are instructions here on how to import a log, but what you need is only the translation functionality.

Essentially, you will use MP to export the .BIN log to cleartext (.LOG) and then use the MATLAB script to convert it to .mat arrays.

Pure scalar messages are converted to double arrays but those containing strings are converted to cell arrays.

@Michael_Oborne Thanks! The \r\n was a minor inconvenience… but I hoped it might also be fixed quite easily. As for strings… I guess I don’t know what I’m missing? So no problem. If there was vital info there, I could get it from the MP log.

@Georacer I will investigate mavlink-inspector. Thanks for the link!

@hunt0r
can you give beta MP a try.

ive added MLCell support, but don’t have matlab to test with

I’ve just tested MP 1.3.43.1 build 1.1.6210.37535. Both “bugs” remain:

  1. The \r\n is still on the last string in each XXX_label.
  2. It looks like all data has been converted, not just MSG, to cell-arrays. This not only greatly increases the file size, and slows the process, but it looks like the indexing isn’t done right, so the .mat file only has the last data of each type. (perhaps every write is overwriting the previous, not appending it to the data?)

@hunt0r thanks for the report back. i will take another look.

I’ve just tested MP 1.3.43.1 build 1.1.6210.37535. Both “bugs” remain:

  1. The \r\n is still on the last string in each XXX_label.
  2. It looks like all data has been converted, not just MSG, to
    cell-arrays. This not only greatly increases the file size, and slows the
    process, but it looks like the indexing isn’t done right, so the .mat file
    only has the last data of each type. (perhaps every write is overwriting
    the previous, not appending it to the data?)