0
0
Drone Programmingprogramming~10 mins

Color-based tracking 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 initialize the camera for color tracking.

Drone Programming
camera = DroneCamera([1]=True)
Drag options to blanks, or click blank then click option'
Athermal_vision
Bnight_mode
Ccolor_tracking
Dauto_focus
Attempts:
3 left
💡 Hint
Common Mistakes
Using night_mode instead of color_tracking disables color detection.
2fill in blank
medium

Complete the code to set the target color for tracking.

Drone Programming
tracker.set_target_color([1])
Drag options to blanks, or click blank then click option'
A'blue'
B'red'
C'ultraviolet'
D'infrared'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'infrared' or 'ultraviolet' which are not visible colors.
3fill in blank
hard

Fix the error in the code to correctly start the color tracking process.

Drone Programming
drone.[1]()
Drag options to blanks, or click blank then click option'
Astart_tracking
Bbegin_tracking
Cinitiate_follow
Dtrack_color
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'begin_tracking' or 'track_color' which are not valid methods.
4fill in blank
hard

Fill both blanks to create a dictionary that maps detected colors to drone commands.

Drone Programming
commands = { [1]: 'move_left', [2]: 'move_right' }
Drag options to blanks, or click blank then click option'
A'red'
B'green'
C'blue'
D'yellow'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping colors or using colors not in the options.
5fill in blank
hard

Fill all three blanks to filter detected colors and execute commands only if confidence is high.

Drone Programming
if detected_color == [1] and confidence [2] [3]:
    execute_command(commands[detected_color])
Drag options to blanks, or click blank then click option'
A'red'
B>
C0.8
D'green'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong color or comparison operator, or missing the confidence threshold.