Home        Store        Docs        Blog

Writing telemetry data (specifically, depth) to gopro video?


(Matthew Spencer) #1

Has anyone worked out a system for writing telemetry data onto the frames of a gopro video? We have everything working in our new BlueROV2, but we want to use gopro video for analysis (we need the highest quality we can get, for counting fairly small organisms such as ascidians), and we want to be able to see the depth on each frame. This sounds like a fairly basic thing, but it’s my first time working with .tlog files.

I’ve converted a .tlog file to .csv using TLogtoCSV.jar from https://www.markbrown.space/tlogtocsv.html. I’m pretty sure I can figure out how to write data to a gopro video frame-by-frame using a python script, once I know what the data mean (I’ve done similar things with OpenROV video before). In the .csv file, I have lines like these:

1512474933651 MAVLINK_MSG_ID_SCALED_PRESSURE - time_boot_ms:4325330 press_abs:1030.7413 press_diff:7.6991405 temperature:3952 Tue Dec 05 11:55:33 GMT 2017 29
1512474933651 MAVLINK_MSG_ID_SCALED_PRESSURE2 - time_boot_ms:4325330 press_abs:1031.6 press_diff:33.64 temperature:896 Tue Dec 05 11:55:33 GMT 2017 137

Is one of those things going to give me depth, if I know the salinity of the water I’m in? At the moment I don’t even know the units of the numbers I’m looking at, although I’m sure it will be obvious to someone.


(Jacob) #2

Units/meanings of each of the fields are here: http://mavlink.org/messages/common.

You can derive the depth yourself using the reported absolute pressure, or use the GLOBAL_POSITION_INT.alt field, which is the depth that the autopilot calculates using the specified GND_SPEC_GRAV parameter for the specific gravity of the fluid you are diving in.


(Jacob) #3

Another useful tool for extracting/filtering data from logs is mavlogdump.py, which is included with a pymavlink installation.

ex.

$ mavlogdump.py --types=GLOBAL_POSITION_INT --format=csv 2017-10-25_14-21-23.tlog
timestamp,GLOBAL_POSITION_INT.time_boot_ms,GLOBAL_POSITION_INT.lat,GLOBAL_POSITION_INT.lon,GLOBAL_POSITION_INT.alt,GLOBAL_POSITION_INT.relative_alt,GLOBAL_POSITION_INT.vx,GLOBAL_POSITION_INT.vy,GLOBAL_POSITION_INT.vz,GLOBAL_POSITION_INT.hdg
1508933673.10899997,1294872,0,0,-2590,-2590,26,-47,62,9595
1508933674.00099993,1295863,0,0,-2410,-2410,41,-64,59,9522
1508933674.22399998,1296103,0,0,-2420,-2420,44,-72,53,9469
1508933674.46199989,1296343,0,0,-2440,-2440,46,-77,48,9401
1508933674.71099997,1296583,0,0,-2460,-2460,49,-80,45,9348
...

(Matthew Spencer) #4

Thank you. That looks like exactly what we need.


(Matthew Spencer) #5

One more question: to synchronize the depth information with the Gopro video, I need to set the system time on the ROV. Is there a way to do that through QGroundControl?


(Jacob) #6

Currently the only way to set the system time of the ROV is to aquire a GPS lock. We should have another way.
https://github.com/bluerobotics/ardusub/issues/131