Welcome to ROSMASTER R2 repository
3. Voice control autopilot
3. Voice control Autopilot
3. Voice control Autopilot3.1. Description 3.2. Steps3.2.1. function package path 3.2.2. Start 3.2.3. Regulated HSV value 3.3. Code analysis3.4. Voice module communication protocol
Raspberry Pi PI5 master controller needs to check this step, Orin master controller does not need it
Before running this program, it is necessary to bind the port number of the voice board and the port number of the ROS extension board on the host computer; When entering the docker, you need to mount the voice board to recognize the voice board in the docker.
3.1. Description
Voice control robot open and close tracking red/blue/green/yellow function, and the R2 key on the handle can stop/start this function at any time.
3.2. Steps
3.2.1. function package path
Raspberry Pi PI5 master control needs to enter the docker container first, Orin master control does not need to enter,
The location of the function source code is located
x~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_voice_ctrl/yahboomcar_voice_ctrl/Voice_Ctrl_follow_line_a1_R2.py~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_voice_ctrl/yahboomcar_voice_ctrl/Voice_Ctrl_follow_line_4ROS_R2.py
The structure of A1 radar between S2 radar is the same and can be shared
3.2.2. Start
Enter the docker, according to the actual vehicle type and radar type, terminal input
x
#Start the voice patrol program A1 radarros2 run yahboomcar_voice_ctrl Voice_Ctrl_follow_line_a1_R2#Start the voice patrol program 4ROS2 radarros2 run yahboomcar_voice_ctrl Voice_Ctrl_follow_line_4ROS_R2#Start the handle control noderos2 run yahboomcar_ctrl yahboom_joy_R2ros2 run joy joy_node#Start A1 radarros2 launch sllidar_ros2 sllidar_launch.py#Start 4ROS radarros2 launch ydlidar_ros2_driver ydlidar_launch.py#Start the car chassisros2 run yahboomcar_bringup Ackman_driver_R2*(Take tracking red for example) *
Put ROSMASTER on the yellow line, adjust the camera position, and push the camera down.
After the program is run, we can say "Hi Yahboom" to wake up the voice module, until it replies "Hi, i'm here", indicating that the module has been woken up.
We can say "Tracking the yellow line" , it will reply "OK, I will track the yellow line".
Next, we press the R2 key on handle, then ROSMASTER starts track the yellow line. If you don't use handle, you can also start ROSMASTER by inputting the following command through the terminal.

If you want to cancel this color tracking function, say "Stop the tracking function", it replies "OK, tracking mode is closed". ROSMASTER will cancel this function.
When the robot is moving, you can pause the robot by pressing the R2 key on handle again.
3.2.3. Regulated HSV value
Note: The HSV value can be modified according to the actual situation. Since the camera is more sensitive to light, it may appear that the HSV value here may be different, and the line tracking effect is not very good. The user can adjust the maximum and minimum values of HSV with dynamic parameters, modify the max and min values of the calibrated color HSV into the above code, and use the calibrated values after restarting the code.
Autopilot program and dynamic parameter adjuster
xros2 run yahboomcar_linefollow follow_line_a1_R2.pyros2 run rqt_reconfigure rqt_reconfigure