Skip to content

Commit 31826a0

Browse files
committed
more information about terrain data
1 parent 8c72a9e commit 31826a0

1 file changed

Lines changed: 49 additions & 9 deletions

File tree

common/source/docs/common-terrain-following.rst

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ Terrain Following in CRUISE and FBWB modes can be disabled with an RC switch ass
6969
Use of terrain following in AUTO missions is controlled on a waypoint by
7070
waypoint basis using the reference frame of the waypoint. Normal (non
7171
terrain following) waypoints have a "Relative" reference frame, and
72-
altitudes are specified relative to the home location. Not by the :ref:`TERRAIN_FOLLOW<TERRAIN_FOLLOW>` parameter. Terrain following
73-
waypoints have a "Terrain" reference frame, and altitudes are relative
72+
altitudes are specified relative to the home location, not by the :ref:`TERRAIN_FOLLOW<TERRAIN_FOLLOW>` parameter.
73+
Terrain following waypoints have a "Terrain" reference frame, and altitudes are relative
7474
to the ground level given in the terrain database.
7575

76-
.. note:: in AUTO mode autolandings, the :ref:`TERRAIN_FOLLOW<TERRAIN_FOLLOW>` parameter does have an impact, when a rangefinder is also used. See :ref:`rangefinder-autolanding`.
76+
.. note:: in AUTO mode autolandings, the :ref:`TERRAIN_FOLLOW<TERRAIN_FOLLOW>` parameter
77+
does have an impact, when a rangefinder is also used. See :ref:`rangefinder-autolanding`.
7778

7879
See :ref:`common-understanding-altitude` for altitude definitions.
7980

@@ -92,30 +93,48 @@ the terrain may vary significantly. Key uses are:
9293
- **FPV flying.** When flying FPV in CRUISE mode it is useful to
9394
maintain constant height above the ground so you can spend more time
9495
enjoying the scenary and less time avoiding hills
96+
- **Regulatory Compliance.** many countries have restrictions on the
97+
altitude drones must fly at or below, often 400' (about 120m). with
98+
terrain following enabled, missions items and other limits including
99+
:ref:`FENCE_ALT_MIN<FENCE_ALT_MIN>` and :ref:`FENCE_ALT_MAX<FENCE_ALT_MAX>`
100+
can be specified in AGL (terrain) frame.
95101

96102

97103
Sources of Terrain Data
98104
=======================
99105

100106
The ground station is normally responsible for providing the raw terrain data which is sent to the aircraft via MAVLink. Right now only Mission Planner and MAVProxy support the required TERRAIN_DATA and TERRAIN_REQUEST MAVLink messages needed for terrain following download support. If you are using a different ground station , in order to download terrain data you will need to connect using one of those two ground stations in order to allow ArduPilot to load terrain data onto your board on the ground or in flight. Once it is loaded, it is saved permanently on the microSD card.
101107

102-
Both MissionPlanner and MAVProxy support the global SRTM database for terrain data. The ArduPilot SRTM server used by MAVProxy and Mission Planner has 100m grid spacing. Unless the ground control station uses a different server with closer spacing, setting the :ref:`TERRAIN_SPACING <TERRAIN_SPACING>` parameter lower than 100m provides no better resolution, and only consumes more space on the SD card.
108+
Both MissionPlanner and MAVProxy support the global SRTM database for terrain data.
109+
The ArduPilot SRTM server used by MAVProxy and Mission Planner provides data with 100m and 30m grid spacing.
110+
Unless the ground control station uses a different server, setting the :ref:`TERRAIN_SPACING <TERRAIN_SPACING>`
111+
parameter other than 100m or 30m provides no better resolution, and only consumes more space on the SD card.
103112

104-
Terrain Data is downloaded any time you save or connect with a loaded mission with these ground stations, or, if flying, the autopilot will request data if it's flying into an area not already downloaded, assuming the ground station can provide it. Usually an internet connection is required by the ground station.
113+
Terrain Data is downloaded any time you save or connect with a loaded mission with these ground stations, or,
114+
if flying, the autopilot will request data if it's flying into an area not already downloaded, assuming the
115+
ground station can provide it. Usually an internet connection is required by the ground station.
105116

106117
.. warning:: While the autopilot will request the terrain data around waypoints and home location, if it is not connected to a GCS that can supply enroute tiles, the autopilot just interpolates between waypoint's terrain elevation. See below:
107118
.. image:: ../../../images/terrain-warning.jpg
108119

109-
If you are not flying with a GCS that can fetch and supply terrain data as the vehicles flies between waypoints, the you may need to load terrain data covering the flight route and/or area for RTL paths manually.
120+
If you are not flying with a GCS that can fetch and supply terrain data as the vehicles flies between waypoints,
121+
the you may need to load terrain data covering the flight route and/or area for RTL paths manually.
110122

111-
You can download a set of terrain data tiles for any anticipated flight area using this `web utility <https://terrain.ardupilot.org/>`__.
123+
You can download a set of terrain data tiles at either 100m (STRM3) or 30m (SRTM1) for any anticipated
124+
flight area using this `web utility <https://terrain.ardupilot.org/>`__.
112125

113126
.. image:: ../../../images/common-terrain-dl-utility.png
114127

115128
It will create tiles for the specified radius around a geographic location. Then you can download them, unzip and write in the APM/TERRAIN folder of the SD card.
116129

117130
You can also download .zip files for entire continents, or individual tiles from `here <https://terrain.ardupilot.org/continentsdat3/>`__.
118131

132+
You may also want to obtain higher resolution data, available from commercial sources online, if you have specialized requirements.
133+
134+
It's a very good idea to remove the SD card from the AutoPilot and copy large terrain data sets directly to
135+
the /APM/TERRAIN folder from your PC, as copying them via MAVFtp in Mission Planner using a USB
136+
or other MAVlink connection is likely to take many, many hours or even days.
137+
119138
Terrain Spacing
120139
===============
121140

@@ -128,7 +147,17 @@ grid spacing for specialist applications.
128147
Note that the amount of terrain data kept in memory is directly related
129148
to the grid spacing. If you decrease the ``TERRAIN_SPACING`` by a factor of
130149
2 then the amount of terrain area kept in memory is reduced by a factor
131-
of 4. It is recommended that you use a ``TERRAIN_SPACING`` of 100
150+
of 4. This may be an issue on older boards with less memory, but for a newer
151+
AutoPilot with 1M of RAM, the :ref:`TERRAIN_CACHE_SZ<TERRAIN_CACHE_SZ>` can be
152+
increased to make better use of available memory for caching terrain tiles. The default
153+
is 12 but a good value on an H743 or H757 processor is probably 60.
154+
155+
30m spacing (SRTM1) data provides a good compromise between accuracy and
156+
bandwidth/storage space and runtime memory requirements. Use ``TERRAIN_SPACING`` = 30
157+
meters for most normal use cases.
158+
159+
If your AutoPilot has less memory, less storage space or communication
160+
bandwidth might be an issue, it is recommended that you use a ``TERRAIN_SPACING`` of 100
132161
meters to prevent the aircraft running off the side of a grid in flight
133162
and not having data available.
134163

@@ -163,7 +192,7 @@ steps
163192
When the autopilot has finished loading terrain data you should see
164193
"ter_pend" goes to zero and the current terrain altitude in meters
165194
showing up in "ter_alt". The "ter_pend" value is the number of terrain
166-
blocks that the autopilot is waiting to load from the ground station.
195+
blocks that the autopilot is waiting to load from the ground station or from the SD Card.
167196

168197
Options
169198
-------
@@ -185,5 +214,16 @@ include climb rates your aircraft cannot achieve.
185214
The climb rate used in the terrain look-ahead is based on the
186215
:ref:`TECS_CLMB_MAX<TECS_CLMB_MAX>` parameter, combined with your current ground speed.
187216

217+
Recommended Settings
218+
====================
219+
220+
- set :ref:`TERRAIN_ENABLE<TERRAIN_ENABLE>` to 1 and :ref:`TERRAIN_FOLLOW<TERRAIN_FOLLOW>` to 1
221+
- set :ref:`TERRAIN_SPACING<TERRAIN_SPACING>` to 30 meters for more precise AGL calculations
222+
- set :ref:`TERRAIN_CACHE_SZ<TERRAIN_CACHE_SZ>` to 60 to load more tiles into memory (RAM)
223+
- set :ref:`TERRAIN_LOOKAHD<TERRAIN_LOOKAHD>` to 1000 meters unless you have a reason to need more
224+
225+
To avoid high bandwidth consumption due to terrain tiles being sent to the aircraft over your telemetry
226+
link, especially if you often fly in different locations, it's also highly recommended to download the
227+
terrain around your planned flight area in the /APM/TERRAIN folder on the SD Card on the AutoPilot.
188228

189229
[copywiki destination="plane"]

0 commit comments

Comments
 (0)