Difference between revisions of "Maps"

From PaparazziUAV
Jump to navigation Jump to search
Line 17: Line 17:
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.
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 ~/paparazzi3/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 ==
== Manually Defined Maps ==

Revision as of 07:34, 5 August 2010

Google Maps

The Paparazzi GCS will automatically download satellite photo tiles from Google for the area defined in the flight plan. 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 donloading. 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 ~/paparazzi3/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).

SRTM Data

The SRTM option from the Nav menu in the GCS displays the ground altitude of the mouse in the top right hand corner. The 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. Some areas (for example high latitudes) are not well covered by official NASA SRTM data. Some additional and data with higher accuracy has been compiled in the same format: http://www.viewfinderpanoramas.org/dem3.html.