So tell me, what is the goal of this post?
The goal is that you, too, see a picture like this:
And... why would anyone want this when we have global satellite coverage via Google Maps?
In some parts of the world, Googles satellite imagery is not very accurate. Custom maps allow you to use a better overview of what your Ardupilot is doing.
Another advantage is that the method detailed in this post works completely offline. That means you don't have to prefetch the region in which you are flying.
A third point is that although not detailed in this post all kinds of overlays over map data can be created by your GIS server before displaying the data on MissionPlanner.
Ok so tell me: What do I have to do?
To follow the first steps of this tutorial you need two things: GeoServer, which is an open source WMS (Web Map Service) server and a GeoTIFF image of the region in which you are flying.
For the purpose of this tutorial, I will be using sample data provided by the USGS.
So, download these things:
GeoServer: http://geoserver.org/display/GEOS/Stable
GeoTIFF: ftp://ftp.remotesensing.org/geotiff/samples/usgs/ (I used c41078a1.tif and c41078a1.lgo)
Create a separate folder, for example "geotiff_examples" somewhere on your computer and put c41078a1.tif and c41078a1.lgo in there.
You said that is for the first steps! What is with the other ones?
Well... the last step currently requires that you download my fork of the MissionPlanner and compile it yourself which is clearly out of scope for this blog post.
If one of the git wizards thinks that my changes are good and helpful this wizard could tell me what to do to get the changes included into the main tree?
The problem currently is that MissionPlanner does not produce completely WMS compliant messages and does not check if the provided WMS server is capable of responding to the MissionPlanner. I fixed that.
My fork is located under https://github.com/korgan/MissionPlanner
tl;dr: That means exactly?
Currently you probably cannot display your image in MissionPlanner.
Okay, lets go; what do I have to do?
Install GeoServer. Installation instructions are located under http://docs.geoserver.org/stable/en/user/installation/index.html
Done. Whats next?
First, you should open your browser and visit the admin homepage, per default it is located at http://localhost:8080/geoserver/web/ . Login and click on "Create Workspaces".
Name the new workspace, in this example I named it "apm_planner_wms" and type in some arbitrary URL. Make it the default workspace. Submit.
Go back to the home screen and click on "Add stores".
Choose the GeoTIFF option. In the next screen, make sure that the workspace is apm_planner_wms, type in a name and a description and browse to the folder where you saved your GeoTIFF from before. Save.
After that, you should see this page:
Click on the "Publish" action. On the following page only one thing is super important: Scroll until you see the "Coordinate Reference System" options. The Declared SRS must be EPSG:4326! You can just type the number in. Save again.
Now, we are ready to test. On the left column, click on "Layer Preview". Search for your layer, probably named "apm_planner_wms:c41078a1".
Click on Select one -> PNG and you should see this image.
If you do not see it, you have done something wrong (or I failed to mention something...). Please read this part of the tutorial again.
As a last thing to do in GeoServer, you have to go to Workspaces -> apm_planner_wms and make sure, that "WMS" under Services is checked.
Wow, that was alot. I need a nonalcoholic beverage.
Me too.
I have followed every step. Now I want this litte image from the preview in my Mission Planner!
Heres the thing: As I have said, unless you compile the Mission Planner from my fork, the following steps will not work.
That makes me sad.
Me too.
I have compiled your Mission Planner! Tell me what to do now!
In the Flight Plan tab on the far right there is a litte scroll down list where you can choose between different maps. Choose "CustomWMS" and adialog should pop up.
Give it the URL of your server ( http://localhost:8080/geoserver/apm_planner_wms/wms ) and click okay. The following box will tell you to choose a layer. Our newly created WMS server has only one layer so we put 0 into the box or just click okay without typing anything.
And there you have it! Our sample tiff is displayed:
Liar! Nothing is displayed! I am ruined, RUINED I say!
Relax. Have a snickers, Did you check that you are at the correct coordinates? The map is quite small, so you have to be around Lat 40.77557094048379 Lng 80.0929875534263
I still do not see anything.
Well, then I forgot a step or you did not follow one.
Your screenshot does not look good at all. Why should I use that again?
Download the sample tiff and zoom in. That is what you get in the Mission Planner, too. And I can tell you that allthough it is not of the very best quality, it is not in the slightest comparable to the low-res screenshot above.
Is there anything more I can do now? This one map is pretty boring.
Yes it is (apart from the fact that maps never are boring). But: You could create your own GeoTIFF. Or you could implement a custom OpenStreetMap server on your laptop. Or you can display other WMS sources like a hydrogeography map of your area or one of the hillshaded maps (http://129.206.228.72/cached/hillshade):
That is Europe if you did not notice.
You convinced me!
Please make sure you say that again in the comments below :-)
Comments
Great to see that it helps! I envy you for your flying environment...
I would recommend to use the CGIAR version of SRTM (http://srtm.csi.cgiar.org/) which contains less errors. For better visualization you could also try to convert the DEM to a hillshaded image (http://wiki.openstreetmap.org/wiki/Hillshading_with_Mapnik). Lastly, you could check if the DLR SRTM data ( http://www.dlr.de/en/desktopdefault.aspx/tabid-6840/117_read-30856/ ) cover your area. I have not worked with these before but they seem more accurate than the NASA ones.
Thanks again Nicholas for your work flow. For back-up of the prefetched Google Earth tiles, I can use the digital elevation maps from both SRTM (NASA Shuttle Radar Topography Mission) and ASTER GDEM (Advanced Spaceborne Thermal Emission and Reflection Radiometer) data sets covering the Eastern Himalayas. Ain't pretty without false colors or contours but it works.
@Michael J, look at video below.
I did use OziExplorer for FPV, while ago, before having my APM and MP.
oFPV with OziExplorer moving map from criro1999 on Vimeo.
Great post! I too am a fan of the OziExplorer package(s). Have just finished 3 months of field work relying of Ozi for my mapping. Love it.
Running custom and offline maps adds so much value to UAV work. Time to update my MP - thanks Michael.
Criro - I'm interested in how you are (were) flying FPV and following on Ozi.
MJ
It's possible to do with arcgis and geotiff images?
@SaadTiwana: Always glad to help! I have not found a definite way to produce the GeoTIFFs. For a free of cost version, try experimenting with http://mapknitter.org Originally this was created for aerial images but it actually works quite good for scanned maps, too. Let me know whether this works for you!
Nicholas,
This is exactly what i have been looking for, for the last few days. Many thanks for posting!
One thing, could you point me to a nice tool for producing the GeoTiff files? I followed the instructions and everything worked. However, since i downloaded the GeoTIFF files, i want to know how to produce them myself from, let's say, a scanned image of a map.
Thanks,
Saad
Thanks Nicholas. Despite the "last updated on" in GE, elevation and ground features such as buildings, etc, are dangerously 2-years old. I would not be surprised if there's a error in elevations. I use digital orthrorectified topos for when I paraglide.
Nice, I'll try it.
I just tested the WMS capabilites with the official release, works flawlessly. Here Mission Planner 1.2.68 with an 1:50000 map near Port Elizabeth, South Africa:
So all things I wrote in my blog post can now be tried by everyone.
@kolin: I just tried it; converting OziExplorer maps to GeoTIFF and loading them in GeoServer takes less than a few minutes plus you can easily automate the workflow. Heres an image of 1:40
@Harry: You can do all that with GeoServer, too. With the added plus that GeoServer can now display the data in Mission Planner. The disadvantage is that switching between layers currently is a little bit inconvinient as it was coded with minimal interference to normal Mission Planner operations. Having a GIS server in the background does convert Mission Planner into a very cabable mapping tool.