Route won't hold altitude: check the Mission Planner Alt column
The number you enter in the Alt column of a Mission Planner route means height above home or above sea level, depending on the Frame setting. That is why the waypoint altitude doesn't hold.
You built the route in Mission Planner and entered 40 on the waypoint rows. The drone switched to AUTO mode and didn't fly at the height you expected.
On some routes it doesn't climb at all and starts descending right after takeoff. If you haven't touched the transmitter, don't look for the problem in the flight controller. The autopilot is reading the route differently from how you read it.
The Frame column determines what the number in Alt means
On the Plan screen, every waypoint row has an Alt column and a Frame column. What you enter in the Alt column is a raw number. The Frame column says what that number is measured against.
Mission Planner opens a new row with the Relative frame. In Relative, entering 40 means 40 meters above the takeoff point. If you change Frame to Absolute on the same row, the number 40 stays in place but now points to 40 meters above sea level.
If you take off from a site at 500 meters elevation in Şanlıurfa, that point ends up 460 meters below the ground. In the figure below, look at where the same 40 goes on two rows: the Relative row points above home, the Absolute row points below the ground.
The same 40, two different targets
The autopilot doesn't object to this. It accepts the route, takes off, then starts descending toward that point.
The Frame column has three options
When describing Mission Planner's Plan screen, the ArduPilot documentation says this in a single sentence: altitudes can be entered as Relative, Absolute, or above terrain.
- Relative · the number is meters above the home point. The default in ArduCopter and the right choice for everyday flying.
- Absolute · the number is meters above sea level. It helps when an airspace ceiling is given in AMSL. If you enter it without adding the home elevation, the target falls below the ground.
- Terrain · the number is meters above the ground. You can't fly this route unless terrain data has been downloaded to the vehicle.
Frame is chosen separately for each row. In a route, the frame values of the rows can be mixed, and the autopilot interprets each row by its own frame.
The autopilot accepts a wrong route too
In ArduCopter 4.7.0, imagine you upload two routes from a home point at 500 meters elevation. In the first, takeoff reads Relative 20, the second waypoint Relative 40, and the third waypoint Absolute 560. In the second, the only difference is the second waypoint's frame: Absolute 40.
The autopilot accepts both routes with MISSION_ACK type 0 and gives not a single warning. The first route hits the 20, 40, and 60 meter steps. The second route peaks at 20 meters, starts descending, and lands.
The Verify Height checkbox rewrites the Alt numbers
The Verify Height checkbox on the Plan screen is a separate trap. When you check it, Mission Planner recalculates the ALT value for every waypoint using Google Earth terrain data and changes the number without asking you.
The official documentation is clear: if a waypoint is on top of a hill, Mission Planner raises the ALT setting by the height of the hill. This is a UI operation; it doesn't touch the autopilot's frame interpretation.
If the home icon isn't on your actual takeoff point, the whole calculation shifts. Move home to the right place before building the route.
Read your route back before going to the field
You can't tell what a route really says by looking at the number on screen. You need to read it back after uploading it to the vehicle. The code below connects, pulls the route row by row, and prints each row's frame value by name.
from pymavlink import mavutil
FRAME = {0: "Absolute (AMSL)", 3: "Relative (above home)", 10: "Terrain (above ground)"}
m = mavutil.mavlink_connection("tcp:127.0.0.1:5760")
m.wait_heartbeat()
m.mav.mission_request_list_send(m.target_system, m.target_component, 0)
say = m.recv_match(type="MISSION_COUNT", blocking=True, timeout=5).count
for i in range(say):
m.mav.mission_request_int_send(m.target_system, m.target_component, i, 0)
it = m.recv_match(type="MISSION_ITEM_INT", blocking=True, timeout=5)
print("%2d cmd=%-3d alt=%8.1f frame=%-2d %s"
% (it.seq, it.command, it.z, it.frame,
FRAME.get(it.frame, "TANIMSIZ")))If you run the code with the first route above loaded, you get this:
0 cmd=16 alt= 500.1 frame=0 Absolute (AMSL)
1 cmd=22 alt= 20.0 frame=3 Relative (above home)
2 cmd=16 alt= 40.0 frame=3 Relative (above home)
3 cmd=16 alt= 560.0 frame=0 Absolute (AMSL)The first row is the home point and always comes as Absolute; this is normal. In the remaining rows, the frame value should be the same as what you see on the Plan screen.
Example: your teammate built the route for the payload drop mission on their own computer at night, and you are uploading it in the field. On the Plan screen all rows say 40 and everything looks fine. When you run the code, the drop point's row comes back as frame=0 Absolute. At a site at 500 meters elevation, that point is below the ground. Change the row's Frame cell to Relative, upload the route again, and read it back once more.
Rehearse a new route in SITL before trying it in the field. The cost of a wrong frame is one log line in simulation and a crash on a real vehicle. Downloading ArduCopter SITL and uploading your own route file is enough for this rehearsal.
Error Messages and Their Meanings
Failsafe: Terrain data missing
On a route where you chose the Terrain frame, no terrain data has been downloaded to the vehicle. When ArduCopter can't find a terrain source, it falls into failsafe. You need to either switch the frame to Relative or download terrain data with an internet-connected ground control station.
Failsafe: Terrain Unavailable
The second form of the same failsafe. This time the vehicle has no terrain source defined at all. If there is no rangefinder either, you can't fly a route with a terrain frame on that vehicle.
PreArm: RTL_ALT_TYPE is above-terrain but no terrain data
You set the RTL_ALT_TYPE parameter to 1, meaning RTL will work relative to terrain. Because the vehicle has no terrain data, ARM permission isn't granted. You need to set the parameter back to 0 or download terrain data.
Auto: Missing Takeoff Cmd
The route has no NAV_TAKEOFF row at the start. When ArduCopter is switched to AUTO mode on the ground, it expects the first command to be a takeoff.
More on Mission Planner
Which flag the frame value turns into inside the firmware, the terrain chain's parameters, and cases from the field are covered step by step in the course.
See the course: Mission Planner from Scratch
Was this article helpful?
Learn this topic from start to finish
Season plan: all six courses for 9 months, ₺790 a month. ₺390 a month for high school and university students, ₺351 the first month with your member code. You can stop in any month you like. Start the Season plan · I'm a student