← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The flight needs terrain heights, and the terrain database is off

Stops itMissions, fence, rally points, terrain

What ArduPilot says:

The mission has waypoints with heights above terrain, and the terrain database (ground heights kept on the SD card) is not available. “terrain disabled”: TERRAIN_ENABLE is 0. “terrain required but disabled”: this firmware was built without the terrain database, as on boards with little memory. “TERRAIN_SPACING can't be <= 0” (4.7): the grid spacing must be a positive number of metres; 100 is the default.

What to do, most likely first

  1. The waypoints were planned with heights above terrain by accident.

    CheckIn the ground station's Plan screen look at the altitude frame of the waypoints: Relative (above home), Absolute (above sea level) or Terrain.

    FixIf you did not mean to follow the ground, change the frame to Relative, check every height again and write the mission.

  2. TERRAIN_ENABLE is 0 while the mission really is meant to follow the ground.

    FixSet TERRAIN_ENABLE to 1, then wait for the data to arrive (“waiting for terrain data”).

  3. The firmware for this board has no terrain database.

    CheckThe message is “terrain required but disabled”, and there is no TERRAIN_ENABLE parameter to set.

    FixPlan with heights above home, or use a board and a firmware build that include terrain.

A copter whose RTL is set to follow the terrain (RTL_ALT_TYPE 1) with the database off gets a different message: “RTL_ALT_TYPE is above-terrain but no terrain data”.

Parameters to look at

ParameterWhat it is
TERRAIN_ENABLETerrain data enable
TERRAIN_SPACINGTerrain grid spacing
The code that sends it

TERRAIN_SPACING can't be <= 0

libraries/AP_Terrain/AP_Terrain.cpp AP_Terrain::pre_arm_checks() · Open in ArduPilot Copter-4.7.1

PreArm: terrain disabled

libraries/AP_Arming/AP_Arming.cpp AP_Arming::terrain_checks() · Open in ArduPilot Copter-4.7.1

PreArm: terrain required but disabled

libraries/AP_Arming/AP_Arming.cpp AP_Arming::terrain_checks() · Open in ArduPilot Copter-4.7.1

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer