Matlab to MySQL

All,
Firstly, hi! I’m a new member to the forum and extremely new to the hobby of RC aircraft.

Secondly, I did some looking around for a better way to review tlogs and couldn’t find anything about it. I came across a few python scripts that didn’t work with the latest version and a handful of simi-working utilities. So I wrote my own. Preferably I’d like this utility to parse the tlog files themselvs but didn’t find a lot of info so I decided to write this to parse the matlab files.

Before I continue, this is an early stage project and I’m putting it here to see if anyone is interested in contributing, so don’t rely on accuracy right now. I’ve only tested this against logs produced by mission planner and converted to matlab. In theory this should work with about anything that’s in matlab format with the autowire flags but I can guarantee it.

How it works
-This is a command line utility that auto maps the matlab file and inserts each data point into a single MySQL table.

How to use it
-The jar can be downloaded here. Both the readme and release notes contain instructions. For brevitiy here is an example

java -jar Telemetry-all-1.0-SNAPSHOT.jar -b -t -c "jdbc:mysql://localhost:3306/" -d "blackbox" -u "root" -p "myPassword" -m "C:\Users\Kristopher Clark\Documents\Mission Planner\logs\QUADROTOR\matlab logs\2016-11-10 17-34-53.tlog.mat" -r "com.mysql.cj.jdbc.Driver"

Sample results
Here’s the table less results that is produced
ID,FLIGHT_NUMBER,chan17_raw_mavlink_rc_channels_t,ygyro_mavlink_scaled_imu2_t,…ETC…
EPOCHTIME-FROM-TLOG,X,X…ETC…

Source code
Can be downloaded from here.

Hi @krisclarkdev

Keep in mind that currently Mission Planner does not convert string fields for DataFlash messages into its MATLAB transcript, so it might not do it for .tlog either.

When converting a DataFlash message containing fields into a .mat file, the output is a < double> array with 0s where the strings were.

Also, just in case you want to borrow some algorithms, I have started doing something similar:

Georacer,
Thanks you for the input. Right now I’m just concerned with the data points from the tlogs such as altitude, lat, long, etc, which this seems to be working well as of right now for this purpose since they are in double.

Regarding the algorithms I’d love to take a look. I think it’d be much better to write this utility to parse the logs directly so I can have more flexibility.

I also plan on making a JavaFX UI for this and using open source BIRT for the data visualization.