Introduction
Flying a drone safely and effectively requires different ways to control it depending on the situation. Flight modes help pilots manage the drone's behavior, making it easier to fly in various conditions without losing control.
Imagine driving a car with different levels of help: Stabilize is like driving with power steering but controlling speed and direction yourself; AltHold is like cruise control keeping your speed steady while you steer; Loiter is like parking with automatic brakes holding the car in place; Auto is like using a GPS autopilot to follow a route without touching the wheel.
┌───────────────┐ │ Flight Modes │ ├───────────────┤ │ Stabilize │ │ Manual flight│ │ with leveling│ ├───────────────┤ │ AltHold │ │ Hold altitude│ │ manual move │ ├───────────────┤ │ Loiter │ │ Hold position│ │ and altitude │ ├───────────────┤ │ Auto │ │ Follow route│ │ automatically│ └───────────────┘
mode = 'Loiter'
if mode == 'Stabilize':
print('Manual control active')
elif mode == 'AltHold':
print('Altitude hold active')
elif mode == 'Loiter':
print('Position hold active')
else:
print('Automatic mission active')def switch_mode(mode):
if mode = 'Auto':
print('Auto mode activated')
else:
print('Other mode')Pass the test and this pattern moves unknown