Maps

From PaparazziUAV
Revision as of 12:42, 10 March 2011 by Esden (talk | contribs)
Jump to navigation Jump to search

Satellite photo map tiles

The Paparazzi GCS can automatically download satellite photo tiles from Google, MS Maps and Openstreetmap for the area defined in the flight plan. The tiles of Openstreetmap are not real photos (YET!) but rendered tiles. These tiles are fully calibrated and automatically stitched together by the GCS. To load the map tiles simply select Maps->Google Maps Fill (Ctrl-F) from the GCS pulldown menu and the tiles corresponding to the GPS coordinates defined in the flight plan will begin downloading. Pan or zoom the map and re-fill to get more tiles. Tiles are saved in var/maps/ for off-line use. Checking Maps->Google Maps Auto will automatically fill the map with tiles while paning and zooming. There is also a command line option to start the GCS with the Auto-fill feature enabled:

path_to_ground_segment/cockpit/gcs -google_fill.  

If you are behind a firewall, you can use a proxy by setting the http_proxy environment variable:

export http_proxy=http://squid:3128

If you wish to create a calibrated map from the Google tiles, so that upon launching the map2d program a map of the area is shown, go ahead and put into view the area you wish to make the map. While holding left click, drag the area for the map. A red border will appear around the area. Next click on Maps->Map of Region or Maps->Map of Google Tiles. While the former will save the visible region (with waypoints, tracks, ...if any, under the current zoom), the latter will stich together the original Google tiles covering the selected region. Save the xml file to the data/maps/ directory. This program will automatically screenshot the image and take reference location points and calibrate the map using them. You will be able to load this map in your next sessions (with the Maps->Load menu or with the -m option you can add in the your section of control_panel.xml.

Example of map created from google tiles, gifhorn.xml:

<map file="gifhorn.jpg" projection="Mercator">
 <point x="0" y="0" geo="WGS84 52.527982 10.452157"/>
 <point x="1965" y="1284" geo="WGS84 52.519595 10.473248"/>
</map>

The GCS currently supports three projections (UTM, Mercator and LambertIIe). If you try to place a calibrated map for one projection (e.g. UTM) on another projection plot (e.g. Mercator) the image will be rotated and skewed and a warning will be shown during loading.

NOTE: Sometimes wrong Google maptiles are downloaded due to the beginning of the bandwidth restriction enforced by Google. If this happen and you do not wan to re-download all of you tiles, close the GCS type the following in a command prompt:

$  cd ~/paparazzi/var/maps/

or maybe some other directory where you installed the Paparazzi software, then type

$ rm ??????????????.jpg

That are indeed 14 questionmarks, better cut and paste the line. This leaves the good resolution images and deletes the bad ones. It would be even better if you could fix the GCS sourcecode and the remove the text of this workaround here from the Wiki

Manually Defined Maps

Maps are used in the groundstation to give geographical reference to the flight area. These calibrated maps are described with two files: the image itself (.png, .jpg or .gif) and an xml file containing geographic references of some points of the bitmap.

For example, muret_UTM.xml:

<map file="muret_UTM.gif" projection="UTM" scale="2.5" approx_ground_altitude="185" utm_zone="31" opacity="100">
 <point x="0" y="0" utm_x="359000" utm_y="4815000" geo="WGS84 43.474630 1.256652"/>
 <point x="0" y="800" utm_x="359000" utm_y="4813000" geo="WGS84 43.456629 1.257169"/>
 <point x="800" y="800" utm_x="361000" utm_y="4813000"/>
</map>

These maps can be created from any image (many are available from various websites). Save the file as a jpeg and place it in the data/maps/ folder. From the GCS select Maps->Calibrate. After loading the image (which is displayed), you will have to choose at least two reference points, name them with their geographic coordinates (in WGS84 or UTM) and save. The created map (an XML file describing the geographical position of your original bitmap) can then be loaded (Maps->Load).

Height Data

Intoduction

The Shuttle Radar Topography Mission (SRTM) obtained elevation data on a near-global scale to generate the most complete high-resolution digital topographic database of Earth. SRTM consisted of a specially modified radar system that flew onboard the Space Shuttle Endeavour during an 11-day mission in February of 2000.

The Paparazzi GCS can use this height data. The SRTM option from the Nav menu in the GCS displays the ground altitude of the mouse in the top right hand corner.

Getting and using SRTM Data

Downloaded SRTM data files (.hgt.zip or .hgt.bz2) must be copied to the data/srtm/ directory. They can be downloaded from http://dds.cr.usgs.gov/srtm/version2_1/SRTM3. For example: http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N47E016.hgt.zip is for 47 deg North latitude and 16 deg East longitude.

Better and more

Some areas, for example high latitudes, are not well covered by official NASA SRTM data. Some additional data and data with higher accuracy has been compiled in the same format: http://www.viewfinderpanoramas.org/dem3.html.

Automating script

If you want to get a specific range of height data, for example if you test your UAS in various areas on a continent, use the script below. Change the values for the ranges you need.

$ nano grabheightdata.sh

Then copy via slecting the script below then CTRL+C and then use CTRL+SHIFT+V to paste it into the nano editor. Then use CTRL+X to save the file.

#!/bin/bash
# Use freely, OpenUAS 2010
# Script to grab ranges of height data, very handy if you test your UAS in various areas in a continent ;)
# Change, add or delete values in 49 50 51 and 003 004 005 006 007 008 009 to get the ranges you need.
i=1
for lat in 49 50 51
do
  j=1
  for long in 003 004 005 006 007 008 009
  do
    let "j+=1"
     wget -N --waitretry=40 "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N"$lat"E"$long".hgt.zip"
  done
  let "i+=1" 
done               
exit 0

then to be able to siply run the script

$ chmod u+x grabheightdata.sh

Finally you can run the script, use and wait a while...

$ ./grabheightdata.sh