Vision · Robot club · about 15 min
set_cv, the tag list, pixels and distance, empty lists.
[1 mark]A program calls apriltags() before it has called set_cv. What does it get?
[1 mark]Each entry in apriltags() is [id, cx, cy, distance]. What is tag[3]?
[1 mark]The picture is 320 pixels wide. What cx does a tag straight ahead of the robot have?
[1 mark]What does this program print?
tag = [7, 160, 120, 45.0]
print(f"marker {tag[0]} at {tag[3]} cm")[1 mark]The robot turns away so no tag is in view, then runs tag = apriltags()[0]. What happens?
tag becomes 0tag becomes an empty list[1 mark]Which of these are true of the list apriltags() gives you?
Tick every answer that is true.
cx is measured in cm[1 mark]Marker 7 is 45 cm away. The robot drives forward 8 cm towards it. About what distance, in cm, should the next apriltags() report?
Switch on the tag detector and print marker 7 at 45.0 cm using the id and distance from the list. Do not drive.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() print(apriltags())
Plan your program here, then type it in and press Run.
cx and cy as well, in the form marker 7 at 45.0 cm, pixel (160, 120).cx on the way in, and why?