Welcome to AI Voice Interaction Module repository
2. Voice control car movement
2. Voice control of car movement
Take our company's product Rosmaster-X3 as an example to explain how to call the Speech_Lib library in the program for voice recognition and then control the movement of the car/robot. This course needs to be combined with the Rosmaster-X3 car hardware, and only code analysis is done here. First, let's look at the built-in voice commands,


1. Start the program
Terminal input,
xxxxxxxxxxroslaunch yahboomcar_voice_ctrl voice_ctrl_yahboomcar.launch

2. Core code
Code path: ~/driver_ws/src/yahboomcar_voice_ctrl/scripts/voice_Ctrl_Mcnamu_driver.py
xxxxxxxxxx#导入语音识别的库 Import the speech recognition libraryfrom Speech_Lib import Speechfrom Rosmaster_Lib import Rosmaster#创建语音识别的对象和驱动控制对象 Create speech recognition objects and driver control objectsspe = Speech()car = Rosmaster()#读取语音识别到的内容 Read the content of speech recognitionspeech_r = spe.speech_read()#发送语音播报内容 Send the speech broadcast contentspe.void_write(speech_r)