Article

Terrain-following drones can lose clearance when height sources change

A flight plan that specifies 30 metres above ground does not necessarily keep a drone 30 metres clear of the surface. The controller may be using a terrain grid, a downward rangefinder or a barometric height estimate, and those sources describe different things. At the edge of a sensor's useful range, in an area with steep relief or when terrain data cannot be retrieved, the meaning of the altitude target can change.

This is a flight-planning and integration problem, not an argument against terrain following. ArduPilot's Copter terrain documentation and PX4's terrain-following guide describe different mechanisms. Both make the source and validity of height information central to the operation.

Three heights that should not share one label

A pilot might encounter altitude above mean sea level (AMSL), altitude relative to the launch or home reference, and height above the local terrain (AGL). These quantities coincide only under special conditions. A takeoff at one elevation followed by flight over a ridge is an obvious counterexample: height above home can remain steady while clearance to the ground shrinks.

A terrain-referenced waypoint ordinarily combines the aircraft's height estimate with a terrain elevation at the aircraft's position. A local rangefinder instead observes the surface along its measurement direction. Neither automatically tells the controller the clearance to a wire, branch, roof edge or other obstacle elsewhere on the route.

ArduPilot Plane documentation distinguishes mission items in the Relative reference frame from Terrain items. A relative waypoint refers to the home height; a terrain waypoint refers to the ground elevation in the terrain database. Changing a mission editor's altitude display without checking the stored reference frame is not a reliable way to audit an uploaded route.

The map is not the ground directly under the aircraft

Terrain grids are useful for route-scale planning, especially where a rangefinder cannot measure far enough. They are sampled representations of a changing landscape. Ridge lines, cuttings, retaining walls and embankments may lie between sample positions. Even a nominal 30-metre grid does not guarantee 30-metre horizontal precision for every local obstacle.

The USGS assessment of SRTM elevation data notes another distinction: radar measurements in vegetated areas can reflect within the canopy rather than the bare ground. In built-up areas, rooftops can affect the sampled elevation. Those effects matter when a flight requires a defined relationship to ground level, vegetation or the highest obstruction, because they are different surfaces.

ArduPilot's fixed-wing terrain guide documents 100-metre and 30-metre terrain-spacing options and the corresponding storage, bandwidth and caching consequences. Increasing the requested sample density does not create terrain detail the underlying service does not have. Ground stations may interpolate to provide the requested grid.

The same documentation records an early-2026 terrain-data issue, resolved by the project on 24 February, and describes warnings in ArduPilot 4.7 for older cached data. This is a useful reminder that a cached tile is not inherently correct because it is available offline. Operators using legacy firmware need to check the project's specific cache-replacement instructions rather than infer safety from the absence of a pre-arm warning.

What happens when the rangefinder stops being valid

A downward rangefinder measures nearby surfaces at a much finer local scale than an elevation database. Its useful envelope is bounded by the particular sensor's minimum and maximum range, mounting geometry, target properties and the controller's health checks.

PX4's terrain-following and holding documentation says its multicopter terrain-following mode uses an altitude estimator and a separate terrain estimate derived from distance sensing to adjust the altitude target. At higher altitudes, when the estimator judges the distance measurement invalid, PX4 switches to altitude following, generally maintaining near-constant AMSL height using its selected absolute-height sources.

Imagine a drone following rising ground at low altitude. If the rangefinder becomes invalid as the surface rises, maintaining nearly constant absolute height does not guarantee the same clearance. The actual outcome depends on the vehicle's speed, sensor transitions, control response and terrain ahead. No generic clearance figure can be inferred from the mode name.

PX4 also distinguishes MPC_ALT_MODE=1 for terrain following from MPC_ALT_MODE=2 for terrain hold. Terrain hold is intended for low-altitude, near-stationary behavior and can switch out when horizontal speed exceeds MPC_HOLD_MAX_XY or valid ranging is lost. Treating those two modes as interchangeable in an operating checklist misses a real difference in their conditions.

ArduPilot has its own distinctions. Its Copter surface-tracking guide describes pilot-controlled height adjustments from a floor or ceiling sensor. When the vehicle climbs beyond the rangefinder envelope, stick input returns to target climb-rate control based on the estimator. When the ground returns within range, the target altitude above terrain is reset to the current measured height. That is a specific handoff, not continuous preservation of a previous clearance target.

Losing terrain data can change the return route

Sensor loss and terrain-data loss are not identical, but both can expose a hidden assumption about the altitude frame.

ArduPilot's Copter terrain documentation describes a two-second terrain-data loss condition during a mission that requires terrain data. In flight, the documented response is RTL. Because terrain information is unavailable, the subsequent RTL interprets its altitude relative to home rather than terrain, regardless of the terrain-relative RTL setting.

This detail can matter more than the original data outage. A return path that was acceptable with terrain-relative climbing may not have adequate separation if the fallback is interpreted against home altitude. The safe response is to design and inspect both paths in advance, including the terrain-data-loss route, not simply verify that an RTL mode exists.

For fixed-wing vehicles, the ArduPilot Plane guide describes terrain look-ahead and the importance of achievable climb rates. A controller needs terrain samples far enough ahead to begin a climb within the aircraft's performance limits. A high ground speed and a steep rise can outrun a physically possible climb even when the map is accurate.

A practical validation plan

A terrain-following setup is best evaluated as several separate claims:

  1. Altitude reference. Read back the actual mission items and confirm which ones use home-relative, AMSL or terrain-relative values. Include takeoff, rally, landing and RTL behavior.
  2. Terrain coverage. Check that the needed terrain tiles are present and current before disconnecting the ground station. ArduPilot's Plane guide describes the pending-tile counter ter_pend and the terrain altitude field ter_alt.
  3. Rangefinder envelope. Validate mounting orientation and minimum and maximum measurements on the actual surface types expected. ArduPilot warns against setting RNGFNDx_MAX above tested sensor capability.
  4. Transition behavior. In simulation, traverse the rangefinder validity threshold, interrupt terrain downloads and change from one altitude mode to another. Record target height, measured range, terrain estimate, flight mode and any failsafe event. Avoid first exploring these cases near obstacles.
  5. Clearance margin. Account for terrain-data uncertainty, trees, structures, position error, sensor angle, control lag and feasible climb gradients. No single documented grid spacing or advertised lidar range captures all of these.

The resulting test is not a pass/fail claim that a drone can 'follow terrain'. It identifies the circumstances under which each height source controls the aircraft and the behavior used when that source stops being trusted.

The operating question

The critical question before a low-clearance autonomous flight is: what altitude will this particular controller command after the next source transition? The answer should be documented for the installed firmware, altitude mode and vehicle type, with a credible fallback route.

A database supplies a wider view but imperfect local detail. A rangefinder observes the nearby surface but only while its measurements remain valid. A barometer or fused absolute-height estimate helps maintain flight when the terrain measurement disappears, yet cannot alone promise ground clearance over rising terrain. Those trade-offs remain even with a flawless mission upload.