Skip to content

Python Logfile Analysis

raemin edited this page Dec 20, 2018 · 11 revisions

To analyze log files collected from either internal flash or with telemetry using android or GCS you can use a set of scripts written in python.

(Regular)User

The easiest solution is to download the windows binary version, as published by mlyle in the dRonin forum (http://jar.lyle.org/~mlyle/logview-20170306.zip for dRonin "Artifice"). Alternatively it's easy to install the official Python package.

  1. install python
  2. install dronin package: from the command prompt type pip3 install dRonin[all] (pip3.exe can be found in C:\Program Files\Python36\Scripts, 36 being python version 3.6)
  3. The logviewer is under C:\Program Files\\Python36\Scripts\dronin-logview.exe on Windows. On Linux and Mac OS X, you can usually start it by typing dronin-logview at the command line.
  4. Use file-open to open a logfile for viewing.
  5. To zoom, use the mousewheel. It works best if you hold the mouse cursor over the time axis.

Later on it is easy to upgrade the logviewer-- from the command prompt type pip3 install --upgrade dRonin[all]

Developer

In order to work on the latest sourcecode instead, you can find these files in the git repository under the python directory. They require the repository to be checked out in order to support analyzing log files from various versions.

From the dRonin directory, you can launch analysis using the command

./python/shell.py path/to/log/file.tll

You may need the arguments -t if the logfile came from firmware.

This will bring you to an IPython environment where you can inspect data objects and plot graphs. For example to plot the Z gyro you would type:

gyro = uavo_list.as_numpy_array(UAVO_Gyros)
plot(gyro['time'], gyro['Z'])
Clone this wiki locally
You can’t perform that action at this time.