UAV Systems Engineering · Module 6
M6-T6: Flight modes
A flight mode is a contract: what the pilot or software controls, and what the vehicle must know to honour it.
Modes decide who controls what. The practical question for autonomy is which mode needs which sensors and what happens when they are lost. A GNSS-denied system is largely a system for keeping position-class modes alive, or degrading gracefully out of them.
Learning objectives
After this lesson, you should be able to:
- Describe the main multicopter modes and the control each hands to the pilot or software.
- State the estimator outputs each mode requires.
- Explain what happens when a requirement is lost in flight (mode fallback and failsafe).
- Select the mode and failsafe configuration for an autonomous test.
Conceptual explanation
Implementation-specific Mode names, availability and fallback rules are PX4-specific and change between releases. Check the flight modes page for multicopters in the documentation of the version you use.
Representative multicopter modes in PX4:
| Mode | What the pilot or software controls | Needs |
|---|---|---|
| Manual / Stabilised | Pilot commands attitude (and thrust) | Attitude estimate |
| Altitude | Pilot commands horizontal attitude and climb rate; vehicle holds height | Height estimate |
| Position | Pilot commands horizontal velocity; vehicle holds position when sticks centred | Horizontal position or velocity estimate |
| Hold | Vehicle holds its position automatically | Position estimate |
| Mission | Vehicle flies stored waypoints | Global position, home, valid mission |
| Return | Vehicle returns to home or a rally point and lands | Global position, home |
| Land | Descends and lands | Position preferred, otherwise descent only |
| Offboard | External software supplies setpoints | Setpoint stream; the matching estimate for the control type |
The commander monitors the estimator validity flags, the link status and the battery. If a mode’s requirement fails, it applies the configured failsafe action (for example hold, return, land or fall back to a lower mode such as altitude or stabilised), depending on parameters and on whether the pilot has control. Careful configuration of these actions is a safety task, not a convenience.

Engineering intuition
Climb a ladder of trust: attitude from the IMU alone is the most robust; height needs a barometer or rangefinder; horizontal position needs GNSS, vision or flow. Each rung needs something external. In a GNSS-denied environment the position rung rests on your vision or lidar odometry, so “position mode works” means “my odometry is valid and fused”.
The failsafe is the safety net and must be tested, because the default may not be what you want. A vehicle flying a vision-aided mission that loses its vision should usually land or hold in altitude mode with pilot takeover, not “return home” using a position estimate it no longer has.
Mathematical formulation
A mode transition can be modelled as a guard on validity flags. Writing , , for validity, the best available mode is the highest rung whose requirements hold. For hysteresis, a requirement lost for longer than a timeout triggers fallback and is restored only after the estimate has been valid for :
The failsafe time budget is the sum of detection, decision and action times; for example if position is lost, the vehicle drifts at the velocity error rate: with a velocity bias the drift after is (a bias of 0.2 m/s over 3 s is 0.6 m).
- req(m)
- set of validity flags required by mode .
- ,
- timeouts for losing and regaining a requirement.
Architecture and data flow
Estimator validity flags (vehicle_local_position flags and the estimator status flags) + link status + battery → commander → vehicle_status (nav_state, failsafe flags) and vehicle_control_mode → controllers and navigator select their setpoint source. A mode change command arrives from the RC, the ground station (a MAVLink command) or the companion (a VehicleCommand message over DDS). The same commander arbitrates all of them.
Real-world UAV applications
- Selecting the correct mode and failsafe for vision-aided and GNSS-denied tests.
- Designing a safe takeover procedure from autonomous to manual.
- Choosing a return strategy that does not depend on a lost sensor.
- Writing the mode-transition section of a test plan.
Implementation example
This runs as shown. A small mode-availability model with validity flags and timeouts, a stand-in for the commander’s logic (not PX4 code). It confirms the fallback order and the hysteresis on a scripted loss and recovery of vision.
import numpy as np
REQ = {'stabilised': {'att'}, 'altitude': {'att', 'alt'}, 'position': {'att', 'alt', 'pos'}}
ORDER = ['position', 'altitude', 'stabilised']
def simulate(valid_pos, T_loss=1.0, T_regain=2.0, dt=0.1):
mode = 'position'; lost_t = 0.0; good_t = 0.0; modes = []
for ok in valid_pos:
if ok: good_t += dt; lost_t = 0.0
else: lost_t += dt; good_t = 0.0
if mode == 'position' and lost_t > T_loss: mode = 'altitude' # position lost: fall back one rung
if mode == 'altitude' and good_t > T_regain: mode = 'position' # regained and stable for T_regain
modes.append(mode)
return modes
valid = np.array([1] * 30 + [0] * 20 + [1] * 40) # vision valid, lost for 2 s, restored
m = simulate(valid, dt=0.1)
t_fall = m.index('altitude') * 0.1; t_back = len(m) - 1 - m[::-1].index('altitude') + 1
print(f"fallback at t = {t_fall:.1f} s, back to position at t = {t_back * 0.1:.1f} s")
assert m[0] == 'position' and 'altitude' in m and m[-1] == 'position'
assert 3.9 < t_fall < 4.2 and 6.5 < t_back * 0.1 < 7.5Configure and test the real behaviour in SITL by removing the aiding source and watching vehicle_status and the failsafe action.
Common engineering mistakes
Assuming the default failsafe suits the mission
Check and set the data-link-loss, estimator-loss and RC-loss actions explicitly.
Return home without a valid position
A return needs a global position estimate; choose land or hold when it is lost.
No pilot takeover plan
The ground pilot must know which mode to switch to and be able to fly it.
Testing only the nominal case
Every mode transition and failsafe needs a test, including recovery.
Confusing an offboard setpoint stream with a mode
Offboard needs both the mode and a live stream.
Failure modes
| Failure mode | How it shows up | Likely cause |
|---|---|---|
| Unexpected mode switch | Vehicle changes behaviour in flight | Estimator or link failsafe triggered fallback |
| Cannot enter position mode | Mode refused | Position estimate not valid (no GNSS or vision fused) |
| Return flies the wrong way | Heads away from home | Home position or frame error; estimate drift |
| Pilot cannot take over | Switch has no effect | RC link or switch mapping not configured |
Debugging approach
- Plot nav_state, failsafe flags and estimator flags together over the flight.
- Read the commander messages in the log console for the reason of each change.
- Reproduce the loss in SITL by disabling the source.
- Check the parameters of each failsafe action against the test plan.
Practical exercises
- List, for your PX4 version, the failsafe parameters and their values for data-link loss, RC loss and estimator loss.
- Write a mode-transition table for a vision-aided mission with a GNSS-denied area.
- In SITL, disable the vision input mid-flight and record the fallback.
- Define the pilot takeover procedure for your test vehicle in two sentences.
Interview questions
Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.
Question 1
What does position mode require that altitude mode does not?
Model answer
A valid horizontal position or velocity estimate from an aiding source such as GNSS, vision or optical flow; altitude mode only needs height and attitude.
Question 2
What should happen when vision odometry is lost in a GNSS-denied flight?
Model answer
It depends on the plan, but typically a controlled fallback (hold in altitude or land, with pilot takeover) rather than a return that relies on the lost position estimate; it must be configured and tested.
Question 3
Why add hysteresis to mode fallback?
Model answer
To avoid chattering between modes when a source flickers: fall back after a loss timeout, and return only after the source has been stable for a regain timeout.
References and further reading
Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.