0
0
Drone Programmingprogramming~10 mins

ArUco marker landing 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 import the ArUco marker dictionary.

Drone Programming
import cv2
aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.[1])
Drag options to blanks, or click blank then click option'
ADICT_7X7_1000
BDICT_5X5_100
CDICT_6X6_250
DDICT_4X4_50
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a dictionary size that does not match the marker size.
2fill in blank
medium

Complete the code to detect ArUco markers in the image.

Drone Programming
corners, ids, rejected = cv2.aruco.detectMarkers(image, [1])
Drag options to blanks, or click blank then click option'
Aparameters
Bcv2.aruco.DetectorParameters_create()
Caruco_dict
Dcv2.aruco.Dictionary_get()
Attempts:
3 left
💡 Hint
Common Mistakes
Passing detector parameters instead of the dictionary.
3fill in blank
hard

Fix the error in the code to estimate the pose of the detected marker.

Drone Programming
rvec, tvec, _ = cv2.aruco.estimatePoseSingleMarkers(corners, marker_length, [1], camera_matrix, dist_coeffs)
Drag options to blanks, or click blank then click option'
Adist_coeffs
Bcamera_matrix
Cparameters
Daruco_dict
Attempts:
3 left
💡 Hint
Common Mistakes
Passing distortion coefficients instead of camera matrix.
4fill in blank
hard

Fill both blanks to draw the detected marker's axis on the image.

Drone Programming
cv2.aruco.drawAxis(image, [1], [2], rvec[0], tvec[0], axis_length)
Drag options to blanks, or click blank then click option'
Acamera_matrix
Bdist_coeffs
Caruco_dict
Dparameters
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of camera matrix and distortion coefficients.
5fill in blank
hard

Fill all three blanks to command the drone to land on the detected ArUco marker.

Drone Programming
if ids is not None:
    x, y, z = tvec[0][0]
    drone.move_to(x[1]0.1, y[2]0.1, z[3]0.1)
    if abs(x) < 0.05 and abs(y) < 0.05 and abs(z) < 0.1:
        drone.land()
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition or multiplication which moves the drone away from the marker.