Welcome to RDK X3 Robot repository
9. Visual Inspection -OpenCV
9. Visual Inspection -OpenCV
9. Visual Inspection -OpenCV1. Program function description3. Program reference path4. The program starts4.1. Modify the HSV value4.2. Start the patrol
1. Program function description
After the program starts, the car will read the set HSV value and automatically follow the path line of the corresponding color.
The [L1] button on the handle locks/turns on the car's motion control. When motion control is enabled, the function is locked; This function can be turned on when the motion control is locked.
3. Program reference path
After SSH connection car, the function source code is located in,
xxxxxxxxxx/userdata/yahboomcar_ws/src/yahboomcar_linefollower/yahboomcar_linefollower/linefollower.py4. The program starts
4.1. Modify the HSV value
After SSH connects to the car, the terminal runs,
xxxxxxxxxxsudo vim /userdata/yahboomcar_ws/src/yahboomcar_linefollower/yahboomcar_linefollower/LineHSV.txtEnter a range of HSV values in the format:
xxxxxxxxxxH_min,S_min,V_min,H_max,S_max,V_maxFor example, enter the range of the black line:

Save and exit.
4.2. Start the patrol
Adjust the Angle of the MIPI camera so that it can recognize the path lines and the background is not cluttered.
After SSH connects to the car, the terminal runs,
xxxxxxxxxxros2 launch yahboomcar_linefollower linefollower_launch.pyYou can see that the car can follow the black path line.

You can change the HSV to a yellow range:

Then the car can follow the yellow path line.
