Simulated missions and Return to Launch
UAT 201 Fundamentals of Unmanned Aircraft Systems
Lesson
By the end of this module you will be able to
- Distinguish mission, waypoint and flight mode, and read the mode sequence from a log
- Explain ArduPilot Return to Launch and PX4 Return with their key defaults
- Calculate a mission's distance, time and energy from waypoints, and check enough energy remains to return
- Plan and run a mission in SITL, keeping evidence others can reproduce
Why this matters
The team’s building photo mission has many photo points. Flown by hand point by point, each round’s photos will not match the same positions, and the pilot tires and makes mistakes. An automatic mission repeats the flight exactly, but you must know what the drone will do when something goes wrong, especially Return to Launch (RTL), the most commonly used way out.
Mission, waypoint and flight mode
- A waypoint is a point with coordinates and altitude for the drone to fly to
- A mission is an ordered list of commands, such as take off, fly to point 1, take a photo, fly to point 2, then return
- A flight mode is how the flight controller interprets commands, such as Stabilize (the pilot flies), Loiter (hold position), Auto (follow the mission) and RTL
Return to Launch
RTL starts when the pilot commands it, or when a failsafe does, such as on loss of the RC signal or low battery. The defaults of the two firmwares differ considerably.
| Step | ArduPilot Copter (RTL) | PX4 (Return) |
|---|---|---|
| Climb | To at least the RTL altitude, default 15 m | To a safe altitude, default RTL_RETURN_ALT 60 m |
| Return | To Home or the nearest rally point | To Home or a rally point |
| Above the destination | Hover RTL_LOIT_TIME, default 5 s | Descend to RTL_DESCEND_ALT 30 m, wait 0.5 s |
| Finally | Land (the default final altitude of 0 means land) | Land |
Parameter names change between versions
In ArduPilot Copter 4.6, the RTL altitude is set with RTL_ALT in centimetres (default 1500). Newer documentation uses RTL_ALT_M in metres (default 15). Always check the firmware version before setting it, and set the RTL altitude above the trees and buildings in the area; the team’s mission around a 20 m building should not use 15 m.
Calculating the mission before flight
Example 1 Mission distance, time and energy
Coordinates are metres from Home (east x, north y), flown at 30 m altitude and 5 m/s, hovering 3 s per photo point, climbing and descending at 1.5 m/s, with an assumed average power of 180 W.
import math
waypoints = [(0, 0), (20, 0), (80, 0), (80, 20), (20, 20), (20, 40), (80, 40), (80, 60), (20, 60)]
speed, vz, alt, photo_s, power_w = 5.0, 1.5, 30.0, 3, 180
legs = [math.dist(a, b) for a, b in zip(waypoints, waypoints[1:])]
mission_m = sum(legs)
back_m = math.dist(waypoints[-1], waypoints[0])
t_mission = alt / vz + mission_m / speed + photo_s * (len(waypoints) - 1)
t_return = back_m / speed + 5 + alt / vz # fly back, hover 5 s, then descend
energy_wh = power_w * (t_mission + t_return) / 3600
print(f"mission path {mission_m:.0f} m, return {back_m:.1f} m")
print(f"time: mission {t_mission:.0f} s + return {t_return:.1f} s = {(t_mission + t_return) / 60:.1f} min")
print(f"energy {energy_wh:.1f} Wh of 61.6 Wh usable ({energy_wh / 61.6:.0%})")
mission path 320 m, return 63.2 m
time: mission 108 s + return 37.6 s = 2.4 min
energy 7.3 Wh of 61.6 Wh usable (12%)
The mission is very short compared with the energy available, but worst cases must be considered too: if the link is lost at the farthest point, or the return is into wind, it takes longer. The 180 W and 61.6 Wh (80% of a 4S 5200 mAh battery) are assumptions; measure real power from the logs of the aircraft used.
Example 2 Can it get home from every point?
Assume a 4 m/s headwind on the way back, leaving a ground speed of 1 m/s. Continuing from Example 1:
headwind = 4.0
ground_speed = speed - headwind
worst_m = max(math.dist(p, waypoints[0]) for p in waypoints)
t_back = worst_m / ground_speed + 5 + alt / vz
print(f"farthest point {worst_m:.1f} m from home; return into a {headwind:.0f} m/s headwind takes {t_back:.0f} s "
f"and {power_w * t_back / 3600:.1f} Wh")
farthest point 100.0 m from home; return into a 4 m/s headwind takes 125 s and 6.2 Wh
The headwind makes the return from the farthest point take several times longer. If the wind speed equals or exceeds the drone’s speed, it cannot get back at all, so check the wind and set mission abort criteria before flying.
Module lab
Lab: simulated mission and RTL in SITL
- Start ArduPilot SITL (Copter) through Mission Planner or QGroundControl, record the firmware version, and set an RTL altitude suited to the hypothetical building.
- Place waypoints as in Figure 1 at 30 m altitude, saving the mission file and parameters before starting.
- Run the mission in Auto, then command RTL part-way, and read the mode and altitude sequence from the log.
- Simulate link loss following lab l10, recording when and how the system changes mode.
- Repeat with the same mission, compare the two rounds’ times and landing points, and give the files to another group to reproduce.
Common mistakes
Watch out
- Using the default RTL altitude without looking at obstacles, such as buildings or trees taller than 15 m
- Entering a parameter in the wrong unit, such as 15 in a centimetre field
- Not checking the Home point before take-off, so the return point is not where you think
- Calculating energy for the mission only, forgetting the return from the farthest point and the wind
- Not recording firmware version and parameters, so others cannot reproduce the run
Summary
- A mission is a command list, a waypoint a destination, and a flight mode sets how commands are interpreted
- ArduPilot RTL defaults to 15 m; PX4 Return defaults to 60 m and descends at 30 m
- Parameter names and units differ between firmware versions
- Calculate distance, time and energy for both the mission and the return from the farthest point, including wind
Check your understanding
- In ArduPilot Copter 4.6, what
RTL_ALTvalue gives a 30 m RTL altitude? - What is the path length of waypoints (0, 0) → (30, 40) → (30, 0)?
- How long does a 100 m return take at a ground speed of 4 m/s?
- How much energy is used at 200 W for 9 minutes?
- A drone flies at 5 m/s into a 6 m/s headwind on the way back. What happens?
Answers
- 3000 (centimetres)
- m
- s
- Wh
- Its ground speed is negative: the wind carries it further away and it cannot return, so do not fly in winds like this
Key formulas
| Path length | |
| Energy used |
Key references
- ArduPilot Dev Team. RTL mode. ArduPilot Copter documentation. link
- PX4 Autopilot. Return mode (generic vehicle). PX4 user guide (main). link
- ArduPilot Dev Team. SITL simulator (software in the loop). link
- ArduPilot Dev Team. Mission Planner simulation. Mission Planner documentation. link
- QGroundControl. QGroundControl user guide. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
Simulated missions and Return to Launch
ArduPilot SITL
QGroundControl
Dropping and restoring a simulated link
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results