RTL could not work out its path
What ArduPilot says:
- RTL: unexpected error setting climb target
- RTL: unexpected error calculating target alt
Two errors that the code itself calls unexpected. “RTL: unexpected error setting climb target”: the first leg of the return could not be set, which happens when the terrain height it was planned on disappears between planning and starting; the copter switches to Land where it is, and the log has “ERR NAVIGATION-2”. “RTL: unexpected error calculating target alt”: the height of home or of the rally point could not be converted, so RTL uses a target height of zero above home and then raises it to the normal return height.
What to do, most likely first
Terrain data or the rangefinder reading came and went at the moment RTL started.
CheckLook for terrain or rangefinder messages in the seconds before it.
FixMake the terrain source dependable (see “Failsafe: Terrain data missing”), or return at a height above home:
RTL_ALT_TYPE0.A rally point was saved with a height the copter cannot convert (a terrain height without terrain data).
CheckRead the rally points back in the ground station and look at their altitude frame.
FixSave the rally points again with heights relative to home.
Parameters to look at
| Parameter | What it is |
|---|---|
RTL_ALT_TYPE | RTL mode altitude type |
RTL_ALT | RTL Altitude |
TERRAIN_ENABLE | Terrain data enable |
Where to do it:Setup & Tuning GuideFailsafe Explainer
The code that sends it
RTL: unexpected error setting climb target
ArduCopter/mode_rtl.cpp ModeRTL::climb_start() · Open in ArduPilot Copter-4.7.1
RTL: unexpected error calculating target alt
ArduCopter/mode_rtl.cpp ModeRTL::compute_return_target() · Open in ArduPilot Copter-4.7.1