Mission Planner geotagging tool seems needlessly complicated

I’m new to ArduPilot but have a lot of prior experience collecting, georeferencing and mosaicking UAV aerial photos using other autopilot systems (chiefly MicroPilot).

I note that ArduPilot has a very handy dataflash logging option (“CAMERA”) that will record all the geotagging data you need each time the autopilot triggers the camera. Therefore in theory, automating the process of geotagging the photos should be a simple matter of reading the dataflash log, extracting the necessary numbers from each one of the “CAM” lines, and matching them up with the corresponding photos in the correct sequence.

That’s why I’m frankly puzzled when reading the instructions on geotagging images with Mission Planner (plane.ardupilot.com/wiki/common- … n-planner/) over the need to estimate time offsets and positional offsets, and I also can’t figure out why on earth you would use the telemetry log to geotag photos when using the dataflash log with the CAMERA option enabled would seem much more straightforward. With the latter approach, there should no need to even know the time that anything took place or worry about positional offsets; again, simple matter of matching the data from the “CAM” lines in the dataflash log with the corresponding sequence of photos.

Is there in fact a way to use the “Geo Ref Images” tool in this much more straightforward manner that isn’t covered in the online instructions? Any enlightenment would be very much appreciated. Thanks.

The reason MP is the way it is is because its the most universal support.

it supports
tlogs.
logs.
logs without camera messages.

and also allows moving the point around to best suit the job.

ie with the camera messages there could be a 1-2 sec delay because of the time the autofocus/shutter takes to trigger. using the current method you can bypass all of this, by providing just a seconds offset.

I see, fair enough. Thanks for the reply.

Even so, I might suggest that, resources permitting, the development team look into updating the Geo Ref Images function in order to be able to handle it the way I described above, as it seems like it would be pretty straightforward.

One last question. Just to be clear, am I correct in assuming that the “shooting time” is read from the image files themselves, i.e. the time set on the camera itself? The example provided in the instructions appears to show that the first photo was actually taken over 2 hours before the log started, which is a bit confusing (is the autopilot in UTC or something?) I ask because if so, it seems like that would require pretty sharp time syncing between the camera and the autopilot, especially for mosaic-mapping missions where you’re shooting overlapping photos just a few seconds apart. Any comments on this?

Thanks again.

do you have a small data set? and I will take a look.

Unfortunately I do not. I test flew a platform with ArduPilot for the first time this week, doing several flights back-to-back. I only flew the very first one with a camera but its dataflash log ended up getting overwritten by the subsequent flights (too many log options enabled: Default + IMU + Camera; in the future I’ll be disabling IMU and a few of the defaults).

With my setup, I would prefer using the data from the CAM messages for geotagging. My camera (Sony NEX5) triggers pretty much instantly so I’m not too worried about a delay, and generally speaking one should always shoot aerial photos with infinity focus, not autofocus. Also, I believe most modern aerial image mosaicking solutions (e.g. Pix4D, DroneMapper, Agisoft) have means of correcting for small systematic errors in photo locations, especially if you’re working with a multi-strip mosaic of overlapping photos.

So as it stands now, for the sake of precision I would actually rather manually extract the CAM data from the dataflash logs myself and use something like GeoSetter to geotag the photos individually than guesstimate with the time offset as per the Geo Ref Images tool in Mission Planner… Which is why I was thinking it would be really handy if you updated the tool in order to be able to automatically match up those CAM messages with a corresponding sequence of photos. I’m imagining some sort of extra button in dialog box that reads “Get from CAM logs” or something that could be used as an alternative to the time offset approach. I’d be happy to send you a dataset to work with after the next time I fly, probably in about a month.

Thanks again for your time.

Hello Mission Planner community. We have been working to develop a UAV capacity to do vegetation mapping in areas that are difficult in our plane. We too have a bunch of experience geotagging photos from a number of different platforms and had the very same question that Undermedia had. We recently flew a small test mission with a sony Nex 7 that we could offer up as a test data set to help move along this process if you all (meee1) are willing. Let me know and we can upload the couple hundred images along with the log files wherever you want them. Thanks for continuing to push all this along and supporting this open source community.

Hello,

My company is also looking into making their aerial mapping UAV’s, and geotagging photos automatically that’s triggered via CHDK and the APM with CAM command, would make life so much easier.
And as undermedia mentioned, you use infinity focus on the cameras to avoid focusing time.

But would be nice if there could somehow automatically geotag the pictures with the GPS data, and as a bonus the current attitude of the aircraft would be very desirable as well so you can compensate for any offset angles in the pictures.

please provide a small data set. so we can target the exact request

What’s a dataset? I do not own an APM yet, but we are highly interested in the unit.
So if I can get you a dataset without APM let me know how and I’ll fix it :slight_smile:

Hi undermedia,

We are also setting up a Skywalker X8 with Sony NEX7 with Tinysnapper to handle the remote trigger using the Mission Planner for photogrammatry work. Trying to find documentation or a how to setup the Tinysnapper with APM2.6.

Any help would greatly be appreciated.

[quote=“undermedia”]Unfortunately I do not. I test flew a platform with ArduPilot for the first time this week, doing several flights back-to-back. I only flew the very first one with a camera but its dataflash log ended up getting overwritten by the subsequent flights (too many log options enabled: Default + IMU + Camera; in the future I’ll be disabling IMU and a few of the defaults).

With my setup, I would prefer using the data from the CAM messages for geotagging. My camera (Sony NEX5) triggers pretty much instantly so I’m not too worried about a delay, and generally speaking one should always shoot aerial photos with infinity focus, not autofocus. Also, I believe most modern aerial image mosaicking solutions (e.g. Pix4D, DroneMapper, Agisoft) have means of correcting for small systematic errors in photo locations, especially if you’re working with a multi-strip mosaic of overlapping photos.

So as it stands now, for the sake of precision I would actually rather manually extract the CAM data from the dataflash logs myself and use something like GeoSetter to geotag the photos individually than guesstimate with the time offset as per the Geo Ref Images tool in Mission Planner… Which is why I was thinking it would be really handy if you updated the tool in order to be able to automatically match up those CAM messages with a corresponding sequence of photos. I’m imagining some sort of extra button in dialog box that reads “Get from CAM logs” or something that could be used as an alternative to the time offset approach. I’d be happy to send you a dataset to work with after the next time I fly, probably in about a month.

Thanks again for your time.[/quote]

Hello,

I have this problem with geotagging images too… I cannot find the right time offset or CAM message in the tlog file. I’m sending you my tlog file and first 5 images in the row of the same flight. I’ve used cam_trig_dist function to do the shooting. I cannot see the content of tlog file as it is binary format. It would be nice if you get luck with my data synchronization… If you get some results, please send me back to info@coni.sk

My setup consists of Pixhawk running latest APM:Plane code and Canon SX260 with gentwireUSB2 cable.

Thanks !

Hello,

now I used the CAM Message Synchro option to look for cam messages in the log file but I’ve got the error :

Using AMSL Altitude False
Reading log for CAM Messages
Log Read with - 91 - CAM Messages found
Read images
Images read : 91
Error System.FormatException: Vstupní řetězec nemá správný formát.
v System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
v System.Double.Parse(String s)
v MissionPlanner.Georefimage.doworkCAM(String logFile, String dirWithImages) v c:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\georefimage.cs:řádek 990
v MissionPlanner.Georefimage.BUT_doit_Click(Object sender, EventArgs e) v c:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\georefimage.cs:řádek 2046

I suspect that the tool is not fully developed yet or it has a bug… It’s a shame… I can send a log if you want…

@coni99

Are you using tlog or data flash log? Could it be that offsets are incorrect?

If you provide the log I’ll try to see what happens.

I use log from dataflash now… there are CAM messages but error is there still… you can see the message up here… the log has 20.9MB so I can send it via dropbox only : dropbox.com/sh/f13qc5tltl9y … D-3AOSwgFa

Coni99

I got the error
I will fix it and PR Michael

It is an internalization error in the parse methods

If you change your location settings to US in Windows, it will work until you get the update

OK there is still one more error: There are 91 CAM messages in the log file but there are 92 images from the flight using the CAM_TRIGG_DIST function of the Mission Planner. I suspect that either the first or last image was not recorded in the log. I cannot find out which one it is because the typical CAM message in the log looks likje this :
CAM, 35898600, 1794, 48.2241277, 18.3050115, 195.16, 23.71, 30.13, 30.27
Neither of these values seem to represent the GPS time of the photo taken. But I may be wrong… It’s anyway hard to decipher the meaning of this georef tool when the documentation seems outdated by far…

I’ve changed my Windows setup to US but nothing changed :
Using AMSL Altitude False
Reading log for CAM Messages
Log Read with - 91 - CAM Messages found
Read images
Images read : 91
Error System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Double.Parse(String s)
at MissionPlanner.Georefimage.doworkCAM(String logFile, String dirWithImages) in c:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\georefimage.cs:line 990
at MissionPlanner.Georefimage.BUT_doit_Click(Object sender, EventArgs e) in c:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\georefimage.cs:line 2046

The extra photo is normal
It always happens at the time the autopilot is powered. The relay is activated by the power up and thus a photo is taken that has not a CAM message.
So basically you have to discard the first photo… but check it!

Please try with this and tell me if the problem goes away

drive.google.com/file/d/0BzRzba … sp=sharing

Thanks ! This works well but there are 3 things:

  • timestamps of images and log are different… so the date is fine but time is shifted few minutes back in the log… you know I have Canon SX260 with own GPS built-in and I’ve set it on during the flight so that I can compare what is the log GPS time and camera GPS time… there is 18 minutes difference… very strange…
  • I cannot find out which image is the extra one not recorded in the log… all 92 images where shot in some 150m altitude above ground and the shooting started immediately after changing the mode to AUTO… there is 3-5s timestamp difference between images so I have no reason to believe any of the images where shot unintentionally… So what I did, I removed the first image in the row and the georef tool now works fine… but I still have no idea which image was the extra one… so it might be a bug in the log recording or not…
  • Location Kml button does not work… it goes into error… never mind, no need to use it as previous step created all the additional files including the kml file…

Hi coni

First, thanks for the debugging

I have found another bug related to GPS Time conversion to UTC. Leap seconds calculation was erroneous and time was being calculated locally. Not UTC
However it does not explain why you see 18 minutes difference.
Are both file creation and EXIF Time the same? Or is there any discrepancy?

As for the missed CAM message. I do not have an explanation. The only thing that could explain it is that there is a known bug in dataflash download from APM/Pixhawk. So maybe you could try to get the bin directly from the SD Card

For the location kml button it does not work in the tool I passed you. No worries