0
0
Drone Programmingprogramming~20 mins

Failsafe actions (RTL, Land, SmartRTL) in Drone Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Failsafe Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this failsafe action code?

Consider this drone failsafe code snippet. What will the drone do if the battery level drops below 10%?

Drone Programming
battery_level = 9
failsafe_action = 'RTL' if battery_level < 10 else 'Land'
print(failsafe_action)
ARTL
BLand
CSmartRTL
DNo action
Attempts:
2 left
💡 Hint

Check the condition for battery level and the assigned action.

🧠 Conceptual
intermediate
2:00remaining
Which failsafe action is best when GPS signal is lost but the drone is over a safe landing zone?

Choose the most appropriate failsafe action for a drone that loses GPS signal but is currently flying over a safe landing zone.

AReturn to Launch (RTL)
BHover in place
CSmartRTL
DLand immediately
Attempts:
2 left
💡 Hint

Think about safety and location when GPS is lost.

🔧 Debug
advanced
2:00remaining
What error does this failsafe code raise?

Analyze the following code snippet and identify the error it will cause when executed.

Drone Programming
def failsafe_action(signal_lost):
    if signal_lost == True:
        return 'SmartRTL'
    else:
        return 'Land'

print(failsafe_action(True))
ASyntaxError
BTypeError
CNameError
DNo error, prints 'SmartRTL'
Attempts:
2 left
💡 Hint

Look carefully at the if statement syntax.

Predict Output
advanced
2:00remaining
What is the output of this SmartRTL decision code?

Given the drone's altitude and GPS status, what will the failsafe function return?

Drone Programming
def decide_failsafe(gps_signal, altitude):
    if not gps_signal and altitude > 20:
        return 'Land'
    elif gps_signal and altitude > 20:
        return 'SmartRTL'
    else:
        return 'RTL'

print(decide_failsafe(True, 25))
ALand
BNo output
CSmartRTL
DRTL
Attempts:
2 left
💡 Hint

Check the conditions in order and the values passed.

🚀 Application
expert
3:00remaining
How many failsafe actions are triggered in this sequence?

Given this sequence of drone events, how many times will the failsafe action be triggered?

events = [
  {'battery': 15, 'gps': True},
  {'battery': 9, 'gps': True},
  {'battery': 8, 'gps': False},
  {'battery': 5, 'gps': False},
  {'battery': 12, 'gps': True}
]

failsafe_count = 0
for event in events:
    if event['battery'] < 10 or not event['gps']:
        failsafe_count += 1
print(failsafe_count)
A3
B4
C2
D5
Attempts:
2 left
💡 Hint

Count events where battery is below 10 or GPS is lost.