0
0
Drone Programmingprogramming~20 mins

Why waypoint navigation enables autonomous missions in Drone Programming - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Waypoint Navigation Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of waypoint navigation sequence
Consider a drone programmed to follow waypoints in sequence. What will be the output of the following code simulating the drone's position updates?
Drone Programming
waypoints = [(0,0), (10,0), (10,10), (0,10)]
position = (0,0)
for wp in waypoints:
    position = wp
    print(f"Drone reached waypoint at {position}")
ADrone reached waypoint at (0, 0)\nDrone reached waypoint at (0, 0)\nDrone reached waypoint at (0, 0)\nDrone reached waypoint at (0, 0)
BDrone reached waypoint at (0, 0)\nDrone reached waypoint at (10, 0)\nDrone reached waypoint at (10, 10)\nDrone reached waypoint at (0, 10)
CDrone reached waypoint at (10, 10)\nDrone reached waypoint at (10, 10)\nDrone reached waypoint at (10, 10)\nDrone reached waypoint at (10, 10)
DDrone reached waypoint at (0, 0)\nDrone reached waypoint at (10, 10)\nDrone reached waypoint at (0, 10)\nDrone reached waypoint at (10, 0)
Attempts:
2 left
💡 Hint
Think about how the loop updates the position variable and prints it each time.
🧠 Conceptual
intermediate
1:30remaining
Why waypoint navigation enables autonomy
Why does using waypoint navigation allow a drone to perform autonomous missions?
ABecause the drone can follow a predefined path without human control once waypoints are set
BBecause the drone requires constant manual control to reach each waypoint
CBecause waypoints allow the drone to avoid obstacles automatically without any programming
DBecause waypoints make the drone fly randomly to explore the area
Attempts:
2 left
💡 Hint
Think about what autonomy means for a drone mission.
🔧 Debug
advanced
2:00remaining
Identify the error in waypoint navigation code
This code is intended to move a drone through waypoints, but it raises an error. What is the error?
Drone Programming
waypoints = [(0,0), (5,5), (10,10)]
for i in range(len(waypoints)):
    print(f"Moving to waypoint {i+1}: {waypoints[i]}")
    drone.move_to(waypoints[i])
    drone.wait_until_arrived()

# drone object is not defined
ASyntaxError due to missing colon in for loop
BIndexError because the loop goes out of range
CNameError because 'drone' is not defined
DTypeError because waypoints is not iterable
Attempts:
2 left
💡 Hint
Check if all variables and objects are defined before use.
📝 Syntax
advanced
1:30remaining
Correct syntax for waypoint list comprehension
Which option correctly creates a list of waypoints with x and y coordinates from 0 to 4?
Awaypoints = [(x, y) for x range(5) for y range(5)]
Bwaypoints = [(x, y) in range(5) for x in range(5)]
Cwaypoints = [(x, y) for x in range(5), y in range(5)]
Dwaypoints = [(x, y) for x in range(5) for y in range(5)]
Attempts:
2 left
💡 Hint
Remember the syntax for nested loops in list comprehensions.
🚀 Application
expert
3:00remaining
Calculate total distance for waypoint mission
Given the waypoints [(0,0), (3,4), (6,8)], what is the total distance the drone will travel following them in order? Use Euclidean distance between points.
A10.0
B12.0
C20.0
D15.0
Attempts:
2 left
💡 Hint
Calculate distance between each pair: sqrt((x2-x1)^2 + (y2-y1)^2) and sum them.