AR QR code tracking

AR Function Pack Location: ~/ArTrack_ws/src/ar_track_alvar/ar_track_alvar

1. Create ARTag

You can enter [ID] and location information here, and end with [-1].

Can generate one or more, layout your own design.

image-20231017204952621

s: Specify the image size.

5: 5x5 image.

33: The number is a QR code for 33.

The generated AR QR code is saved in the directory of the terminal running the instructions.

2. ARTag identification tracking

Note: When starting the camera, it is necessary to load the camera calibration file, otherwise it will not be recognized.

The supporting virtual machine has been calibrated for USB_ The parameter file required for cam startup. If it is not available, you need to follow the following tutorial for calibration.

2.1 Camera internal reference calibration

Install the camera calibration feature pack.

Using USB cam to drive the camera.

Start the calibration node program.

Size: Calibrate the number of internal corner points on the chessboard, such as 9X6, with a total of six rows and nine columns of corner points.

Square: The side length of a chessboard, measured in meters.

Image: Set the image topic posted by the camera.

image-20231017210526744

Place the prepared calibration checkerboard (7 * 10 | size: 20mm) in front of the camera.

image-20231017210356125

X: The left and right movement of the checkerboard in the camera's field of view

Y: Move the checkerboard up and down in the camera's field of view

Size: The forward and backward movement of the checkerboard in the camera's field of view

Skew: Skew rotation of the checkerboard in the camera's field of view

After successful startup, place the chessboard grid in the center of the screen and change different poses. The system will autonomously recognize, and the best scenario is for the lines below [X], [Y], [Size], and [Skew] to change from red to yellow and then to green as the data is collected, filling as much as possible.

Click on 【CALIBRATE】to calculate the camera's internal parameters. The more images, the longer the time, and just wait.

(Sixty or seventy pieces are enough, too many can easily get stuck)

image-20231017211223006

Click 【SAVE】to save the calibration results. The calibration results will be saved in the directory of the terminal running the calibration program.

Input following command to move it out:

After decompressing, there are just calibrated images, an OST.txt file, and an OST.yaml file inside.

The yaml file is what we need, but it still needs to be modified before we can use it.

2.2 Start ARTag recognition tracking

image-20231017212135425

In rviz, it is necessary to set the corresponding camera topic name.

Launh file parsing.

Node parameters:

2.3 View node diagram

image-20231017212356262

2.4 View TF Tree

image-20231017212447101

2.5 View the output topic information

The display is as follows:

image-20231017212613058