Terrain failsafe: the height above ground is no longer known
What ArduPilot says:
- Failsafe: Terrain …
- Failsafe: Terrain data missing
- ERR FAILSAFE_TERRAIN (Subsys 23)
The copter was flying at heights measured above the ground (terrain following in Auto, Guided or RTL) and the ground height was unavailable for 5 s, or a command that needs it could not start. It switches to RTL flown at a height above home instead (already in RTL: “Restarting RTL - Terrain data missing”); if RTL cannot start it lands after a 4 s pause; on the ground it disarms. A height above home takes no account of hills: watch the copter and be ready to take over. “ERR FAILSAFE_TERRAIN-1” marks the event, code 0 the return of the ground height.
What to do, most likely first
The rangefinder lost the ground: the copter climbed above its range, or flew over water, tall grass or a steep slope.
CheckIn the log compare RFND.Dist with the height flown in the seconds before the message.
FixPlan terrain-following flights well inside the rangefinder's working range. When a downward rangefinder is fitted and its use in missions is on (the default), it alone is the terrain source: the terrain database is not used as a backup.
The terrain database had no data for this place: the ground station never sent it, or there is no SD card to store it.
CheckThe ground station's terrain status shows tiles still pending.
FixBefore the flight connect a ground station that has internet access and wait until the terrain for the whole route is loaded; keep an SD card in the flight controller and
TERRAIN_ENABLEat 1.The mission or RTL asks for heights above terrain, but no terrain source is set up at all.
FixEither set up a source (a downward rangefinder, or the terrain database) or plan with heights relative to home.
Parameters to look at
| Parameter | What it is |
|---|---|
RTL_ALT_TYPE | RTL mode altitude type |
WPNAV_RFND_USE | Waypoint missions use rangefinder for terrain following |
TERRAIN_ENABLE | Terrain data enable |
RNGFND1_TYPE | Rangefinder type |
RNGFND1_MAX_CM | Rangefinder maximum distance |
RTL_ALT | RTL Altitude |
Where to do it:Failsafe ExplainerMission Energy CheckSetup & Tuning Guide
The code that sends it
Failsafe: Terrain …
ArduCopter/events.cpp Copter::failsafe_terrain_on_event() · Open in ArduPilot Copter-4.7.1
Failsafe: Terrain data missing
ArduCopter/events.cpp Copter::failsafe_terrain_on_event() · Open in ArduPilot Copter-4.6.3