Ardupilog - A DataFlash log to MATLAB converter

New Dataflash logs include additional messages encapsulating field units and multipliers.
With https://github.com/Georacer/ardupilog/pull/77 now Ardupilog can store this information within each logMsgGroup, on the fieldUnits.<fieldName> and fieldMultipliers.<fieldName> attributes.

I getting the following error messages

log = Ardupilog()
Undefined function or variable ‘LogMsgGroup’.

Error in Ardupilog/createLogMsgGroups (line 315)
new_msg_group = LogMsgGroup(newType, newName, newLen, newFmt, newLabels);

Error in Ardupilog/readLog (line 134)
obj.createLogMsgGroups(data’);

Error in Ardupilog (line 68)
readLog(obj);

Any help would be appreciated

Hi,

Can you provide me with the log you are trying to read?
I’m not getting any errors with the current master on my logs.

Thanks George. File attached.

Err, are you sure? I don’t see a link or attachment anywhere…

Hi, II have noticed that the data flash logs in newer 3.9 7 above base ardupliot are not being read by Matlab. This is the error:
Error using Ardupilog/addprop
‘FMT’ is already defined as a property.

Error in Ardupilog/createLogMsgGroups (line 320)
addprop(obj, newName);

Error in Ardupilog/readLog (line 134)
obj.createLogMsgGroups(data’);

Error in Ardupilog (line 68)
readLog(obj);

Thanks for bringing this up. Can you provide me with a log, so that I can test and fix?

Hi George,

Thanks for the response. I have uploaded a sample log: https://www.dropbox.com/t/YUf3uycJNNVZCYnA

@Georacer : Were you able to download the file?

Yes, 1.7MB. I’ll look into it.

Hm… I’m getting a different error:

In an assignment  A(:) = B, the number of elements in A and B must be the same.

Error in Ardupilog/buildMsgUnitFormats (line 374)
                multValues(unitIdx) = multValue;

Error in Ardupilog/readLog (line 184)
            obj.buildMsgUnitFormats();

Error in Ardupilog (line 68)
        readLog(obj);

I’ll check it nonetheless, but can you make sure what error you get with the log you sent me?

FYI, started an issue here, because it looks a bit perplexing and the discussion might take long: https://github.com/Georacer/ardupilog/issues/79

This is super awesome. I’m using it for a GUI application for flight analysis.

EDIT: Is there a way to create empty Ardupilog structs to manipulate multiple sets of logs? I’d like to create a drop down menu with different logs. I want to define it as a public property.

Example:

plogs = [{ardupilog_1}, {ardupilog_2}, {ardupilog_3}, … {ardupilog_n}]

Hm… I’m not sure I understand your end-goal and I foresee a lot of back and forth. Care you open an issue with a use-case example where we can talk more?

Hi. I realize this is made for MATLAB, but have anyone made it work in Octave? I am attempting to do so but it seem to give up before I get prompted to input a file. As a former Matlab user I believe it is superior, but there are many reasons to use open source software, and Octave is not a bad alternative when it comes to that.

1 Like

I haven’t tested against Octave, but I would suggest that you skip the file selector GUI by providing the filename directly: log = Ardupilog('/path/to/log').
It might give you better chances of working.

Thank you for the tip. I tried, but get the same error.

>> log = Ardupilog('15.BIN')
parse error near line 83 of file C:\Users\torby\Downloads\ardupilog\Ardupilog.m
  syntax error
>>>                 for prop = properties(obj)'
                                        ^
>>

So it might be some small difference between Octave and Matlab I am not understanding.

Ah, it seems that Octave does not have the same method for querying which are the attributes of a class. And I don’t know if it has that ability at all. Probably the API for introspection isn’t the same as Matlab’s.

I’m sorry, but I cannot help you further, as I don’t plan to support Octave too.

I understand that, and I don’t expect support on software the code is not written to run on. Thanks for looking into it, that was helpful.

Hi George, Thank you very much for your hard work!

I tried to run the matlab script to analyze my .bin file but get the following error :

Error using >
Matrix dimensions must agree.

Error in Ardupilog/findBootTimeUTC (line 507)
leapseconds = sum(recv_gps_datenum > leap_second_table);

Error in Ardupilog (line 74)
obj.findBootTimeUTC();

Error in test_log_matlab (line 1)
log = Ardupilog()

Also attached is the .bin file i’m trying to analyze. Is there a way to fix this issue? thank you very much

1 31-12-1969 19-00-00.bin (488 KB)