Friday, January 27, 2017

Geotag GoPro Images using a Pixhawk Log File

By Brian Christal & Stephanie Pelczar

To add geotags to your GoPro images you will need to 1) set your GoPro's time to GPS time 2) set up and fly a mission with your Pixhawk-based UAV while taking pictures with your GoPro then 3) add geotags to your images using Mission Planner.

Set your GoPro time to GPS time.
  The minutes and seconds on your phone time are automatically synced to GPS time. DO the  
  following to sync your GoPro's minutes and seconds to GPS time:
    1. Install GoPro's phone app.
    2. Use GoPro's documentation to pair your phone and GoPro.

    3. In the GoPro app, select Settings> Set Date and Time to sync your GoPro to your phone's time.

Set up and fly a mission.
    1. Make sure LOG_BITMASK is set to 655358. This will make your Pixhawk record CAM
      trigger messages in its log file. You will use the messages to help determine the hour difference
      of your GoPro and GPS time.

    2. Create your flight grid and add a DO_SET_CAM_TRIGG_DIST command. Set to 20 meters.
      This is just for writing a CAM message to your Pixhawk log file, not for actually triggering your GoPro.
    3. Set your GoPro to Time Lapse mode, take a picture about every two seconds and fly your

Add geotags using Mission Planner.
    1. Create a folder on your computer and copy the .bin file from your mission (on your Pixhawk SD  card).
    2. Start Mission Planner> Flight Date> DataFlash Logs tab >PX4 bin to log. Load your
     .bin file and save it as a .log file.
    3. Copy your pictures from your GoPro to the new folder with your log file.
    4. In Mission Planner, select Control + F.
    5. Select Geo ref images.
    6. Select Browse Log and select your .log file.
    7. Select Browse Pictures and choose your pictures.

8. Select Time offset, then Estimate Offset. This example shows an offset of -17988.4. This is the difference between the time the Pixhawk recorded its first camera trigger message and the time stamp on the first picture. This number is not accurate because the GoPro was taking pictures before the UAV even took flight, but it lets us know what number to use based on the tie zone difference. Minutes and seconds on the image timestamps are already accurate, we just need to know how many hours to offset in seconds. There are 3600s/hr, so a five-hour offset is 18000s. The real number we need for Seconds Offset is (negative) -18000.

   Hours    Seconds
   1            3600
   2            7200
   23          82800

     9. Enter your corrected offset in the Seconds offset box and press the Pre-Process button.
    10. Press the GeoTag Images button.
    11. Your geotagged images will be added to a new folder named geotagged inside the folder with
      the photos.


No comments:

Post a Comment