Servers by jDrones

Ardupilog - A DataFlash log to MATLAB converter


(George Zogopoulos Papaliakos) #1

Hello everyone!
Almost two years ago, @hunt0r and I needed to parse some ArduPlane logs. We are both on our track to get a PhD in UAV control systems and Matlab is a very common tool in our trade.

Sadly, at the time the only tool able to convert from DataFlash logs (.bin) to a format readable by Matlab was Mission Planner and it didn’t serve our needs well enough. It would work only on Windows, take a very long time to convert and would ignore all text fields.

So, we decided to create our own converter, Ardupilog. It is Matlab-based, meaning that you need Matlab to run it.
It can read all DataFlash logs, since they are self-defining, and create a versatile log object.
You can even “flatten” the log into a classic struct, if you want the information to be independent of our library.

Example Usage

Reading a log

Add the Ardupilog source code to your path.

log = Ardupilog()

will open a file browser, where you can select the log file you want to decode.
The variable struct log will be generated with the included message types as fields.
Its contents can be normally processed with Matlab commands:

Filtering messages

You can optionally filter the log file for specific message types:

log_filtered = log.filterMsgs(<msgFilter>)

msgFilter can be:

  • Either a vector of integers, representing the message IDs you want to convert.
  • Or a cell array of strings. Each string is the literal name of the message type.


Typically, only a small portion of the flight log is of interest. Ardupilog supports slicing logs to a specific start-end interval. For example, to keep log messages from boot time 1000sec to 2500sec:

sliced_log = log.getSlice([1000, 2500], 'TimeS')

Exporting to plain struct

Creating a more basic struct file, free of the Ardupilog dependency, is possible with:

log_struct = log.getStruct()

log_struct does not need the Ardupilog source code accompanying it to be shared.

More information can be found on the repo’s README.

Next Steps

While presently Ardupilog does not receive regular updates, features that we’d like to see supported at some point are:

  1. Support for MAVLink .tlog logs
  2. Incorporation of DataFlash units for messages fields
  3. Interpolation of message field timeseries, where applicable

We hope this little project proves useful to those who need it. :grinning:

(Mark) #2

Nice work !
would love give it a try …

(vbnhu) #3

I think in Ardupilog.m the GPS leap second row (405.) has a missing data: ‘Jan 1 2017’
There is +1 second introduced over Dec 31 2016 (

Otherwise excellent work!

(George Zogopoulos Papaliakos) #4

Indeed, our tables were out of date.

Thanks for noticing it and for your comments!