Welcome to K210 Module repository
6.Following the apriltag
6 Following the apriltag
6 Following the apriltag 6.1 experimental description 6.2 experimental target 6.3 experimental operation 6.4 experimental results 6.5 the experiments are summarized
6.1 experimental description
The present experiment was to belong to expand the class of experiments, the need to match other external devices to use, here to the car chassis and the ROS expansion Board is not part of K210 module kit contents, so the present experimental results are for reference only, if there is no corresponding device is not directly use the routine code.
ROS expansion Board needs advance programming firmware: ROS-CAR. hex
Due to the use of the motor voltage is 8. 4V, so the ROS expansion Board battery may not be inserted 12. 6V battery, you need to insert 8. 4V battery.
Trolley motor connected to the line as shown below:
Motor Motor 1 is connected to the Left Front wheel, the Motor Motor 2 is connected to the left rear wheel, motor Motor 3 is connected to the right front wheel, the Motor Motor 4 is connected to the right rear wheel.

K210 module with the ROS expansion Board connected to the line sequence as shown below:
White(GND) connected to GND, yellow(5V) is connected to VCC, the black(RXD) connect the SCL, the red(TXD) connected to SDA.

Here you note that the illustration of the logo for the I2C line sequence identity, but K210 using serial communication, due to the burning of the ROS-CAR. the hex file has been put on this interface modification for the serial signal, so in fact the ROS expansion Board on the interface corresponding relationship is: the SCL is actually TX, SDA is actually RX.

6.2 experimental target
This lesson is mainly learning K210 module with the car chassis to do a visual inspection of the line features.
The present experiments the reference code path is: CanMV\06-export\follow_apriltag.py
6.3 experimental operation
ROS expansion Board to burn the firmware: ROS-CAR. hex
Insert the RGB light strip into the RGB light interface of the ROS expansion board.
Please CanMV\06-export\library directory under the trolley driver library and PID control Library in advance to download to the memory card root directory.
Open CanMV IDE open follow_apriltag. py code and downloaded to the K210 module.
The K210 module via the 4PIN cable is connected to the ROS expansion Board.
The trolley into the white background, breaking move K210 module bracket to a suitable angle, turn the car switch.
The machine code is placed into the car camera to capture a range, the movement of the machine code, the car followed the machine code motion.
6.4 experimental results
Wait for the system initialization is completed, the car in the absence of recognition to machine code when it is not moving, when the machine code into the car camera to capture the range, the car began to follow the machine-code movement, keep the machine code on the video screen in the Middle, due to camera capture range is limited, move the machine code of the time can not be too fast, otherwise it will be out of the box and not follow the machine code.

6.5 the experiments are summarized
The car following the machine code function is to use K210 module acquires the camera screen, by the algorithm detects the machine code of the location, through the PID algorithm to calculate the trolley motor current required amount of motion, and then control the car to follow the machine-code movement.