Terrain Protocol

The Terrain Protocol provides a mechanism for a vehicle to request terrain information (tiles) from a ground station, and to stream progress of that information to the ground station.

Support for this protocol is indicated by AUTOPILOT_VERSION.capabilities by the MAV_PROTOCOL_CAPABILITY_TERRAIN flag.

A vehicle that supports this capability must also support terrain following in missions using the data. Note however that a vehicle may also support terrain handling in missions using a distance sensor, even if this protocol is not supported and capability flag is not set.

Message/Enum Summary

MessageDescription
!!crwdBlockTags_22_sgaTkcolBdwrc!TERRAIN_REQUESTRequest from drone (to GCS) for terrain data. The message specifies a mask indicating what tiles are required, and the GCS responds by sending TERRAIN_DATA for each tile. The drone will also stream TERRAIN_REPORT messages to provide progress updates while it is waiting for data.
!!crwdBlockTags_23_sgaTkcolBdwrc!TERRAIN_DATATerrain data from GCS for a particular tile (sent in response to a TERRAIN_REQUEST). The lat/lon and grid_spacing must be the same as the lat/lon from a TERRAIN_REQUEST.
!!crwdBlockTags_24_sgaTkcolBdwrc!TERRAIN_REPORTThe drone will stream TERRAIN_REPORT to indicate progress until completion.

The TERRAIN_CHECK message is not needed/part of the protocol.

Sequences

Drone Get Tile Data

The sequence for a drone to update its terrain altitude information is entirely driven by the drone, and is shown below.

In summary, the sequence is:

  1. Drone sends TERRAIN_REQUEST to the GCS to request a set of tiles (specified in a mask).
  2. The GCS responds by sending a TERRAIN_DATA for each tile set in the mask
  3. The drone also streams TERRAIN_REPORT messages back to the GCS indicating the current state of the download
    • TERRAIN_REPORT.pending and TERRAIN_REPORT.loaded indicate how many tiles are expected and have arrived, respectively.
    • TERRAIN_REPORT.lat, .lon, .terrain_height, while duplicated in other messages, are useful for debugging (a GCS can check its own internal terrain data against what the information).
  4. The Drone must maintain its own record of what tiles have arrived/not arrived, and can re-request any that are missing using a further TERRAIN_REQUEST (with mask indicating just the missing tiles)

The diagram below shows the way the data is encoded within the TERRAIN_REQUEST and TERRAIN_DATA.

Terrain_report.mask data layout

TERRAIN_REQUEST.mask is a 64-bit value that represents a row major 8x7 array of (4x4) tiles. The the lat, lon fields indicate the position of the South-West corner of first grid position (tile). The tiles are allocated sequentially in rows (West to East) starting from the lowest significant bit of mask, and then in columns (South to North).

Each tile represents a 4x4 grid of altitude information. The spacing between the rows/columns in the tile is indicated by grid_spacing (the same value must be used in both request and data messages).

results matching ""

    No results matching ""