Challenge - 5 Problems
Flight Mode Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of Stabilize mode control loop
Consider a drone programmed to run a control loop in Stabilize mode. The code snippet below simulates one iteration of the control loop adjusting pitch and roll based on pilot input. What is the output of the print statement?
Drone Programming
pilot_input = {'pitch': 5, 'roll': -3}
stabilize_output = {axis: val * 0.8 for axis, val in pilot_input.items()}
print(stabilize_output)Attempts:
2 left
💡 Hint
Think about how each input value is multiplied by 0.8.
✗ Incorrect
The code multiplies each pilot input value by 0.8, so 5 * 0.8 = 4.0 and -3 * 0.8 = -2.4.
❓ Predict Output
intermediateAltitude hold mode altitude update
In AltHold mode, the drone tries to maintain a target altitude. Given the code below, what will be the value of current_altitude after running?
Drone Programming
target_altitude = 100 current_altitude = 95 altitude_error = target_altitude - current_altitude correction = altitude_error * 0.5 current_altitude += correction print(round(current_altitude))
Attempts:
2 left
💡 Hint
Calculate the error and then the correction applied.
✗ Incorrect
The error is 5, correction is 2.5, so new altitude is 95 + 2.5 = 97.5, rounded to 97.
❓ Predict Output
advancedLoiter mode GPS position update
A drone in Loiter mode holds position using GPS. The code below simulates a small GPS drift and correction. What is the final position printed?
Drone Programming
position = {'lat': 40.0, 'lon': -74.0}
gps_drift = {'lat': 0.0001, 'lon': -0.0001}
correction_factor = 0.9
position['lat'] += gps_drift['lat'] * correction_factor
position['lon'] += gps_drift['lon'] * correction_factor
print({k: round(v, 5) for k, v in position.items()})Attempts:
2 left
💡 Hint
Multiply the drift by the correction factor before adding.
✗ Incorrect
Latitude: 40.0 + 0.0001*0.9 = 40.00009; Longitude: -74.0 + (-0.0001)*0.9 = -74.00009.
❓ Predict Output
advancedAuto mode mission waypoint count
In Auto mode, the drone follows a list of waypoints. Given the code below, how many waypoints will the drone attempt to visit?
Drone Programming
mission_waypoints = [(40.0, -74.0), (40.1, -74.1), (40.2, -74.2), (40.3, -74.3)] visited = [True, False, True, False] remaining = [wp for wp, v in zip(mission_waypoints, visited) if not v] print(len(remaining))
Attempts:
2 left
💡 Hint
Count waypoints not yet visited.
✗ Incorrect
Two waypoints have visited=False, so 2 remain to visit.
🧠 Conceptual
expertFlight mode behavior comparison
Which flight mode will maintain the drone's position using GPS and automatically correct for wind drift without pilot input?
Attempts:
2 left
💡 Hint
Think about which mode holds position automatically using GPS.
✗ Incorrect
Loiter mode uses GPS to hold position and correct for drift automatically.
