0
0
Drone Programmingprogramming~10 mins

Waypoint radius and acceptance in Drone Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the waypoint acceptance radius to 5 meters.

Drone Programming
drone.set_waypoint_radius([1])
Drag options to blanks, or click blank then click option'
A10
B5
C0
D15
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero as radius means no acceptance area.
Using too large a radius may cause early waypoint acceptance.
2fill in blank
medium

Complete the code to check if the drone is within the acceptance radius.

Drone Programming
if drone.distance_to_waypoint() [1] drone.waypoint_radius():
    print('Waypoint reached')
Drag options to blanks, or click blank then click option'
A<=
B==
C>
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using > instead of <= causes wrong logic.
Using == may fail due to floating point precision.
3fill in blank
hard

Fix the error in the code to correctly update the acceptance radius.

Drone Programming
drone.waypoint_radius = [1]
Drag options to blanks, or click blank then click option'
Adrone.waypoint_radius(10)
Bdrone.set_waypoint_radius(10)
C10
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Calling setter methods instead of assigning value.
Using incorrect method names.
4fill in blank
hard

Fill both blanks to create a dictionary of waypoints with their acceptance radius if the radius is greater than 3.

Drone Programming
accepted_waypoints = {wp: [1] for wp in waypoints if wp.radius [2] 3}
Drag options to blanks, or click blank then click option'
Awp.radius
B>
C<
Dwp.position
Attempts:
3 left
💡 Hint
Common Mistakes
Using position instead of radius as value.
Using less than operator instead of greater than.
5fill in blank
hard

Fill all three blanks to filter waypoints with radius less than 5 and create a dictionary with waypoint names in uppercase as keys and their radius as values.

Drone Programming
filtered = [1]: [2] for wp in waypoints if wp.radius [3] 5}
Drag options to blanks, or click blank then click option'
Awp.name.upper()
Bwp.radius
C<
Dwp.name
Attempts:
3 left
💡 Hint
Common Mistakes
Using original names instead of uppercase.
Using greater than operator instead of less than.