MissionPlanner icon indicating copy to clipboard operation
MissionPlanner copied to clipboard

Add support for AP_Terrain messages

Open rmackay9 opened this issue 12 years ago • 16 comments

Message below from Tridge on this subject:

The terrain following code is now in master. Both plane and copter will communicate with the GCS to fill the terrain database, but only plane will use the terrain data to follow terrain so far. Rover already has great terrain following, so it didn't need any changes :-)

There are a few more pieces that need to be filled in on ground stations:

  • ground stations need to respond to TERRAIN_REQUEST messages. A TERRAIN_REQUEST is a request for a block of 4x4 terrain heights sent from the vehicle to the GCS. The GCS needs to lookup its terrain database and send the data back to the vehicle in a TERRAIN_DATA response.
  • ground stations should generate TERRAIN_CHECK messages to ensure the vehicle has terrain data needed for a mission. The vehicle will send a TERRAIN_REPORT in response. If the grid_spacing in the TERRAIN_REPORT is zero then the vehicle doesn't yet have data for that location. The vehicle will automatically start to pull data from the GCS for that location with TERRAIN_REQUEST messages
  • ground stations should add the ability to generate terrain following mission items, by setting the frame type of the mission item to MAV_FRAME_GLOBAL_TERRAIN_ALT
  • ground stations should show terrain subsystem status, using the MAV_SYS_STATUS_TERRAIN health bits in SYS_STATUS

I've done a new release of MAVProxy with all these elements done, so we can test terrain following now in SITL for plane. To test with mavproxy use:

set terrainalt 1

that will tell mavproxy to create mission items as MAV_FRAME_GLOBAL_TERRAIN_ALT.

You should also set the parameter TERRAIN_FOLLOW:

param set TERRAIN_FOLLOW 1

that tells APM:Plane to use terrain altitude for RTL, CRUISE and FBWB. Use of terrain altitude for mission items and guided mode is controlled by the frame type in the mission item.

Note that terrain following is not available on APM1/APM2. Attempting to upload a terrain mission on APM1/APM2 will fail.

Right now terrain following doesn't do any lookahead. This means it can fly into the ground if the slope is greater than the climb rate the plane can achieve. We can fix that by adding spiral climbs, but that hasn't been done yet.

Cheers, Tridge

rmackay9 avatar Jul 25 '14 03:07 rmackay9

I assume the default terrain database is from SRTM. Is there a way to use a custom terrain database?

ReMapHI avatar Jul 26 '14 01:07 ReMapHI

with what other source?

meee1 avatar Jul 26 '14 02:07 meee1

I've been able to load our own custom imagery as you've shown here: http://vps.oborne.me/gcs/CustomImages.htm We used this method to display a DEM from airborne lidar, since this has higher resolution / higher accuracy than SRTM, especially for planning low altitude surveys over complex terrain.

However, in addition to the visual display of our custom imagery, it would be extremely helpful if Flight Plan could support 2 features:

  1. using a custom elevation database for the "verify height" function
  2. view those custom elevation values under the lat/long values in the Action panel.

lidar_dem_mp

ReMapHI avatar Jul 26 '14 02:07 ReMapHI

+1! That would be fantastic.

iskess avatar Jul 26 '14 02:07 iskess

what format is original source?

meee1 avatar Jul 26 '14 04:07 meee1

This particular dataset is GeoTIFF, but any GIS raster format would suffice.

ReMapHI avatar Jul 26 '14 04:07 ReMapHI

you cannot pull elevation data from a image like the one in your screenshot. as its been normalized.

meee1 avatar Jul 26 '14 04:07 meee1

the geotiff should work however. what coord system do you normaly use? utm?

meee1 avatar Jul 26 '14 05:07 meee1

We use Geographic more than UTM since the GPS data are usually reported in lat/long format. However, it is no problem for us to convert between various coordinate systems in GIS.

ReMapHI avatar Jul 26 '14 05:07 ReMapHI

hi Michael, ground stations no longer need to check that the mission has terrain data, as AP_Terrain now does that automatically (and for rally points too)

tridge avatar Aug 06 '14 07:08 tridge

Now that Automatic Terrain Following is available in APM, it would be extremely helpful to add support for custom terrain databases in Mission Planner. SRTM is still not suitable for some areas.

To illustrate the discrepancies, here's a line-of-sight comparison between SRTM, IfSAR and LiDAR terrain_comparison

ReMapHI avatar Aug 07 '14 18:08 ReMapHI

can you supply one of your images as a sample to test against? I have started to look at geotiff support.

meee1 avatar Aug 07 '14 23:08 meee1

Ok, here is a link to one of the tiles

https://www.dropbox.com/s/aeikpdwhsksy2xw/4QFJ622370_lmsl.tif

ReMapHI avatar Aug 07 '14 23:08 ReMapHI

This issue is still open. Has there been any progress in supporting custom terrain data? The link to the sample data in my previous post is no longer valid, so here is a new one: https://copy.com/zdXsVik6mtYrphIZ

ReMapHI avatar Jul 27 '15 03:07 ReMapHI

Perhaps this is falling off the radar because the title of the original issue doesn't match this request. We need a new issue titled something like "Importing custom terrain data (DEM) into Mission Planner". It should reference this discussion and reintroduce the request. Someday we will have flight planning with 3D maps, until then we at least need the ability to import accurate elevations to use with the existing tools.

iskess avatar Sep 05 '15 19:09 iskess

Yes, closing this item which is complete and adding a new one with the additional request made here. https://github.com/diydrones/MissionPlanner/issues/985

By the way, anyone can add new issues.

rmackay9 avatar Sep 06 '15 04:09 rmackay9