0
0
Drone Programmingprogramming~10 mins

Formation flying basics 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 leader drone's speed to 5 meters per second.

Drone Programming
leader_drone.set_speed([1])
Drag options to blanks, or click blank then click option'
A10
B5
C0
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero speed which stops the drone.
Setting speed too high causing instability.
2fill in blank
medium

Complete the code to make the follower drone maintain a distance of 3 meters behind the leader.

Drone Programming
follower_drone.set_follow_distance([1])
Drag options to blanks, or click blank then click option'
A1
B5
C3
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting distance to zero causing collision risk.
Using a distance larger than leader speed.
3fill in blank
hard

Fix the error in the code to correctly update the formation position of the follower drone.

Drone Programming
follower_drone.update_position(leader_drone.position [1] follower_drone.offset)
Drag options to blanks, or click blank then click option'
A-
B*
C/
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Adding offset causing follower to move ahead.
Multiplying or dividing positions causing errors.
4fill in blank
hard

Fill both blanks to create a dictionary mapping each drone's ID to its current altitude if altitude is above 10 meters.

Drone Programming
altitudes = {drone.id: drone.[1] for drone in drones if drone.[1] [2] 10}
Drag options to blanks, or click blank then click option'
Aaltitude
B>
C<
Dspeed
Attempts:
3 left
💡 Hint
Common Mistakes
Using speed instead of altitude.
Using '<' which filters drones below 10 meters.
5fill in blank
hard

Fill all three blanks to create a dictionary of drone IDs with their speeds if speed is less than 8 m/s.

Drone Programming
slow_drones = {drone.[1]: drone.[2] for drone in drones if drone.[2] [3] 8}
Drag options to blanks, or click blank then click option'
Aid
Bspeed
C<
Daltitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using altitude instead of speed.
Using '>' which filters faster drones.