Inertial log format

These files contain measurements of the acceleration, magnetic field and angular rotation rates measured throughout the trial. They are measured at a constant 100Hz sampling rate. These were measured using an SK6 SHAKE sensor pack, using the built in logging firmware to log directly to on-device flash. These files are the raw dumps extracted from the flash recording.

The data file is in ASCII format and has an entry on each line. Each field is a constant number of characters, and the data is comma seperated. Each entry consits of a timestamp and a sensor reading. The lines have the following structure:
 $TIM,nnnnnnnnnnnnnn,$sss,xxxxx,yyyyy,zzzzz 

Scales

The sensor values should be reasonably well calibrated, but the angular rate sensor in particular is generally subject to significant drift.

Example

An example:
$TIM,1247663638.517,$ACC,-0185,+0011,+1033
$TIM,1247663638.517,$MAG,-0040,+0189,+0462
$TIM,1247663638.517,$ARS,-0136,-0081,-0037
The sensor readings are interleaved, and there should always be an ACC, MAG and ARS reading for each unique timestamp.

Parsing

parse_inertial.py is a simple Python script which will read a file in this format, and return three Numpy arrays (one for the accelerometer, one for the magnetometer and one for the gyroscope). This data will be a time-series with a fixed 100Hz sampling rate.
Example usage:
  import pylab
  acc, mag, gyro = sensors_to_array("trial-1-1_phone-3.txt")
  # plot the first acceleration axis
  pylab.plot(acc[:,0])