Failsafe Actions: RTL, Land, and SmartRTL
📖 Scenario: You are programming a drone to handle emergency situations safely. When the drone loses connection or faces a critical battery level, it must perform a failsafe action to protect itself and its surroundings.There are three main failsafe actions:RTL (Return to Launch): The drone flies back to its starting point.Land: The drone lands immediately at its current location.SmartRTL: The drone decides the safest way to return home, avoiding obstacles.
🎯 Goal: You will create a program that stores the drone's failsafe actions, sets a current failsafe mode, and then prints the action the drone will take in an emergency.
📋 What You'll Learn
Create a dictionary called
failsafe_actions with keys 'RTL', 'Land', and 'SmartRTL' and their descriptions as values.Create a variable called
current_mode and set it to 'SmartRTL'.Use a
for loop with variables mode and description to iterate over failsafe_actions.items() and find the description for current_mode.Print the message
"Failsafe action: <description>" where <description> is the description of the current failsafe mode.💡 Why This Matters
🌍 Real World
Drones must handle emergencies safely to avoid crashes or damage. Programming failsafe actions helps drones respond automatically when something goes wrong.
💼 Career
Understanding how to manage emergency procedures in drone software is important for drone operators, developers, and engineers working in robotics and unmanned aerial vehicles.
Progress0 / 4 steps