12. Apriltag tag code tracking

12.1. Introduction

Apriltag tag code tracking is based on Apriltag tag code recognition, and adds the function of robot arm movement. The robot arm will keep the tag code in the middle of the vision and move. Based on this feature, the tag code tracking function is realized.

12.2. Startup

12.2.1. Preparation before program startup

This Apriltag tag code uses the TAG36H11 format. The factory has equipped the relevant tag code and attached it to the building block. You need to take out the building block and place it under the camera screen for identification.

12.2.2. Program description

After the program is started, the camera captures the image, puts the tag code into the camera screen, and the system will identify and frame the four vertices of the tag code and display the ID number of the tag code. Then slowly move the position of the building block, and the robot arm will move with the building block.

Note: When the building block moves, the tag code should face the camera, and the moving speed should not be too fast to prevent the robot arm from being unable to keep up.

image-20240702165110669

12.2.3, Program Startup

12.2.4, Source Code

Code path: ~/jetcobot_ws/src/jetcobot_advance/jetcobot_advance/apriltag_tracking.py