Introduction
Imagine your drone suddenly loses connection or faces a problem while flying. You need a way to keep it safe and avoid crashes. Failsafe actions are automatic responses that help protect your drone in these risky moments.
Imagine you are hiking and suddenly your phone dies or you get lost. You have three options: walk back the way you came (RTL), stop and wait for help where you are (Land), or use a smart map that guides you safely around obstacles back to your starting point (SmartRTL).
┌───────────────┐
│ Drone Lost │
└──────┬────────┘
│
▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Return to │ │ Land │ │ SmartRTL │
│ Launch (RTL) │ │ (Immediate) │ │ (Safe Route) │
└──────┬────────┘ └──────┬────────┘ └──────┬────────┘
│ │ │
▼ ▼ ▼
Flies back Lands where Plans best
to start point drone is now path home
RTL failsafe action do when triggered on a drone?failsafe = 'SmartRTL'
if failsafe == 'RTL':
action = 'Return to launch point'
elif failsafe == 'Land':
action = 'Land immediately'
elif failsafe == 'SmartRTL':
action = 'Return home avoiding obstacles'
else:
action = 'Hover in place'
print(action)def set_failsafe(action):
if action = 'RTL':
return 'Returning home'
elif action == 'Land':
return 'Landing now'
else:
return 'Hovering'battery = 15 # percentage
gps_signal = False
if battery < 20 and gps_signal:
failsafe = 'SmartRTL'
elif battery < 20 and not gps_signal:
failsafe = 'Land'
else:
failsafe = 'RTL'
print(failsafe)Pass the test and this pattern moves unknown