I am trying to figure out how to interpret and use the gyro and accelerometer data from the .fit file produced by my Virb XE? Perhaps someone can offer me some tips or advice? Here's what I think I understand as well as what I would like to know.
I want to extract some of the location and motion data for my videos to be able to use the information in other applications. Using the FitCSVTool I extracted the timestamp_correlation, record, gyroscope_data and accelerometer_data messages from a .fit file into four separate csv files. In theory (I think) this should give me what I need to calculate the location and attitude of my Virb XE for any point in time in a video.
The location part seems a no-brainer - add the time offset in seconds for each record point to the start time of the recording (from the timestamp_correlation info) and convert the semicircles to decimal degrees. Done.
But how do I calculate the correct time offset for any gyro or accelerometer sample? For example, my gyroscope_data output csv files contain the following fields (and the accelerometer_data file contains similar fields):
timestamp[s], sample_time_offset[ms], gyro_x[counts], gyro_y[counts], gyro_z[counts], timestamp_ms[ms]
I get that the timestamp[s] field is the offset in seconds of each gyro sample from the start time, but how do I use the array of values in the sample_time_offset[ms] field and the timestamp_ms[ms] field? I imagine I will combine them in some way to obtain the milliseconds of offset of each of the 30 samples in the xyz array. Correct? For each sample is the correct offset calculated by summing each component? In other words, if i is the index of the xyz samples do I simply sum the parts:
timestamp[s] + timestamp[ms] + sample_time_offset[ms](i)
Once I understand how to represent the time offset I can build a 4-dimensional array of offset, gyro_x, gyro_y and gyro_z values and from that I can obtain a discrete gyro (or accelerometer) sample for any moment in the video by fetching the values from the array:
offset(i), gyro_x(i), gyro_y(i) and gyro_z(i)
Do I understand all this correctly so far? But how do I interpret the values in the gyro_x, gyro_y and gyro_z as well as the accel_x, accel_y and accel_z fields? The units are in counts. Is there a documented method to convert these to something I can use in other formulas or applications?