Using AprilTags with the AI Vision Sensor

AprilTags are visual markers designed for easy detection and identification by computer vision systems. These square tags feature a unique black and white pattern that allows cameras and software to quickly recognize them and determine their precise position and orientation in 3D space.

There are 38 different AprilTags, numbered 0 through 37. For a printable copy of these AprilTags, click here to download the PDF version or click here to download the Cricut ZIP (SVG) version.

Three AprilTags are being tracked by the AI Vision Utility. Each tag is identified, located, and outlined, indicating its tracking by the system. The AprilTag IDs in this example read 0, 3, and 9.

Each AprilTag has an identifiable ID number that allows the AI Vision Sensor to differentiate between them. This allows the AprilTags to be used for navigation around a field or identify points of interest.

Go here for more information on how to use data about detected AprilTags in your Blocks, Python, or C++ VEXcode projects.

Enable AprilTag Detection

To be able to detect AprilTags, its Detection Mode must first be enabled in the AI Vision Utility.

AI Vision Sensor Settings menu in VEXcode EXP with the sensor labeled as AIVision1. A large AI Vision Sensor icon is displayed, and beneath it, a blue button labeled Configure is highlighted.

Select Configure in the AI Vision Sensor's device menu.

AI Vision Utility menu with the AprilTags option highlighted. By default this option is turned off.

The AI Vision Utility will open. Select the toggle underneath AprilTags to turn on the AprilTag Detection Mode.

AI Vision Utility with the AprilTags option turned on and an AprilTag identified in the sensor's video feed. The Close button is highlighted in the bottom right corner.

Select Close to exit the AI Vision Utility.

VEXcode EXP Devices menu is opened to the AI Vision Sensor Settings menu. The settings menu lists that the AprilTags Detection Mode is set to on. The Done button in the bottom right corner is highlighted.

You will see the new AprilTag Detection Mode be set to on.
Select Done to save your changes to the AI Vision Sensor's configuration.

AprilTag Specific Data

The AI Vision Sensor collects and reports specific data related to April Tags.

Example of an AprilTag identified in the AI Vision Utility video feed. The AprilTag's ID is listed and it reads 7.

ID refers to the unique Tag ID of each April Tag, which can be seen in the upper left corner of the Tag. 

Example of an AprilTag identified in the AI Vision Utility video feed. The AprilTag's angle is listed and it reads 355 degrees.

Angle refers to the rotational angle of the sensor in relation to the AprilTag. It is reported in degrees from 0-359.

Coding with AprilTags in VEXcode EXP

Example project thumbnail that reads Detecting AprilTags (AI Vision).

 

To see the AI Vision Sensor interact with AprilTags in real time, use the Detecting AprilTags (AI Vision) Example Project found within VEXcode EXP. 

To learn how to use Example Projects in VEXcode EXP, go here.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: