yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
AI Voice Interaction Module📖
1. Module information
  • 0. Get started quickly
  • 1. Introduction to Voice Interaction Module
  • 2. Modify the wake-up word and command word
  • 3. Customized protocol entry creation
2. Firmware burning
  • Module firmware burning method
3. Multi-master communication
IIC communication
  • For STM32
  • For Arduino
  • For MSPM0G3507
  • For MSPM0G3519new
  • For ESP32
  • For PICO
  • For RPi5
  • For Jetson
  • For RDK X5
USART communication
  • For STM32
  • For Arduino
  • For MSPM0G3507
  • For MSPM0G3519new
  • For ESP32
  • For PICO2
  • For RPi5
  • For Jetson
  • For RDK X5
4. PC serial port communication
  • PC serial port communication
5. ROS voice interaction
ROS1
  • 1. Environment Construction
  • 2. Voice control car movement
  • 3. Voice control Autopilot
  • 4. Voice control color tracking
  • 5. Voice control multi-point navigation
ROS2
  • 1. Environment Construction
  • 2. Voice control car movement
  • 3. Voice control Autopilot
  • 4. Voice control color tracking
  • 5. Voice control multi-point navigation
Download
  • Code
  • Python driver library
  • Firmware
  • Communication Protocol
  • Software Tools
  • Voice chip datasheet
  • 3D Model File
Download ZIP

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,

image-20230530181142910

image-20230530181159610

1. Start the program

Terminal input,

xxxxxxxxxx
ros2 run yahboomcar_voice_ctrl Voice_Ctrl_Mcnamu_driver_X3

image-20230530181359200

2. Core code

Code path:~/driver_ws/src/yahboomcar_voice_ctrl/yahboomcar_voice_ctrl/Voice_Ctrl_Mcnamu_driver_X3.py

xxxxxxxxxx
#导入相对应的语音库 Import the corresponding speech library
from Speech_Lib import Speech
#导入相对应的底层驱动库 Import the corresponding underlying driver library
from Rosmaster_Lib import Rosmaster
#创建语音控制对象 Create a speech control object
spe = Speech()
#创建底层控制的对象 Create an underlying control object
self.car = Rosmaster()
#读取语音板识别的结果,speech_r就是识别的结果,是底层库解析后会返回一个数字,通过这个数字来识别指令
#Read the result of the speech board recognition, speech_r is the result of the recognition, and the underlying library will return a number after parsing, and use this number to identify the command
speech_r = spe.speech_read()
if speech_r == 2 or speech_r == 0 :
....
#写入指令,播报语音结果,这里的发送指令后,底层库会包装打包后发送给语音板,语音板接收到后,发出相对的音频文件
#Write the command and broadcast the voice result. After sending the command here, the underlying library will package and send it to the speech board. After receiving it, the speech board will send the corresponding audio file
spe.void_write(speech_r)
#控制小车运动和灯带,直接对接底层库,没有通过ros发布 Control the movement of the car and the light strip, directly connect to the underlying library, and do not publish through ros
self.car.set_car_motion(vx, vy, angular) #小车运动 Car movement
self.car.set_colorful_effect(6, 6, parm=1) #灯带效果 Light strip effect

 

Environment Construction
Voice control Autopilot

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文