Challenge - 5 Problems
Flight Dynamics Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
ā Predict Output
intermediateOutput of drone pitch adjustment calculation
What is the output of this code that calculates the new pitch angle after a control input?
Drone Programming
def adjust_pitch(current_pitch, input_value): # input_value is the change requested new_pitch = current_pitch + input_value * 0.1 if new_pitch > 30: new_pitch = 30 elif new_pitch < -30: new_pitch = -30 return new_pitch print(adjust_pitch(25, 100))
Attempts:
2 left
š” Hint
Think about how the pitch is limited to a maximum of 30 degrees.
ā Incorrect
The function increases pitch by input_value * 0.1, so 25 + 100*0.1 = 35, but since max pitch is capped at 30, the output is 30.
š§ Conceptual
intermediateWhy is understanding drone inertia important?
Which reason best explains why understanding a drone's inertia is essential for flight control?
Attempts:
2 left
š” Hint
Inertia relates to motion and resistance to change.
ā Incorrect
Inertia is the resistance to change in motion, so knowing it helps control how the drone responds to commands and external forces.
š§ Debug
advancedIdentify the error in drone yaw control code
What error does this drone yaw control code produce when run?
Drone Programming
def yaw_control(current_yaw, turn_rate): # turn_rate in degrees per second new_yaw = current_yaw + turn_rate * 0.5 if new_yaw > 360: new_yaw - 360 elif new_yaw < 0: new_yaw = 360 + new_yaw return new_yaw print(yaw_control(350, 30))
Attempts:
2 left
š” Hint
Check how the code handles yaw values greater than 360.
ā Incorrect
The code adds 30*0.5=15 to 350, resulting in 365. It checks if new_yaw > 360 and subtracts 360, so 365-360=5. But the code returns 365.0 without wrapping correctly because the result of the subtraction is not assigned back to new_yaw.
š Syntax
advancedSyntax error in drone altitude control function
Which option contains the correct syntax for this altitude control function?
Drone Programming
def altitude_control(current_altitude, change): new_altitude = current_altitude + change if new_altitude < 0 new_altitude = 0 return new_altitude
Attempts:
2 left
š” Hint
Check for missing colons and correct indentation.
ā Incorrect
Option D has the correct colon after the if statement and proper indentation. Others have missing colon, wrong indentation, or wrong assignment operator.
š Application
expertCalculate total thrust needed for hover
A drone weighs 1.5 kg. Gravity is 9.8 m/s². To hover, the total thrust must equal the drone's weight force. What is the total thrust in Newtons needed for hover?
Attempts:
2 left
š” Hint
Weight force = mass Ć gravity.
ā Incorrect
Weight force = 1.5 kg à 9.8 m/s² = 14.7 N. The thrust must match this to hover.
