yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Voice interaction module📖
1.Introduction
  • Introduction
2.Write the firmware
  • Write the firmware
3.PC serial port control
  • Control via PC serial port communication
4.MCU control course
  • RPI code
  • Jetsonnano code
  • Arduino code
5. ROS1 Using Tutorialsnew
  • 1、Environmental construction
  • 2、Voice control of car movement
  • 3、Voice controlled automatic driving for car line inspection
  • 4、Voice controlled car color tracking
  • 5、Voice controlled multi-point navigation
6. ROS2 Using Tutorialsnew
  • 1、Environmental constructionnew
  • 2、Voice control of car movement
  • 3、Voice controlled automatic driving for car line inspection
  • 4、Voice controlled car color tracking
  • 5、Voice controlled multi-point navigation
Download
  • MCU Course Code
  • ROS2 Code
  • ROS1 Code
  • Communication_protocol
  • Software File
Download ZIP

Welcome to Voice interaction module repository

2、Voice control of car movement

2、Voice control of car movement

Take our company's product Rosmaster-X3 as an example to illustrate how to call Speech in the program_ The Lib library performs speech recognition to control the motion of the car/robot. This course needs to be combined with the hardware of the Rosmaster-X3 car, and only code analysis will be done here. Firstly, let's take a look at the built-in voice commands,

functional wordSpeech recognition resultsVoice broadcast content
Stop2OK , I'm stop
Go ahead4OK , let's go.
Back5OK , I‘m back.
Turn left6OK , I‘m turning left.
Turn right7OK , I‘m turning right.
Close light10OK, light is closed.
Red light up11OK, red light is on
Green light up12OK, green light is on.
Blue light up13OK, blue light is on.
Yellow light up14OK, yellow light is on.
light A15OK, light A is on.
lightB16OK, light B is on.
light C17OK, light C is on.
display power18OK, battery value has been display .

1、Run Case Program

The terminal inputs the following commands,

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 voice library
from Speech_Lib import Speech
#Import the corresponding underlying driver library
from Rosmaster_Lib import Rosmaster
#Create voice control objects
spe = Speech()
#Create objects for underlying control
self.car = Rosmaster()
#Read the results of speech board recognition, speech_ R is the result of recognition, which is a number returned by the underlying library after parsing, which is used to identify instructions

speech_r = spe.speech_read()
if speech_r == 2 or speech_r == 0 :
....
#Write instructions and broadcast voice results. After the instructions are sent, the underlying library will package and send them to the voice board. After the voice board receives them, it will send out corresponding audio files
spe.void_write(speech_r)

#Control the movement of the car and the light strip, directly connect to the underlying library, not released through ROS
self.car.set_car_motion(vx, vy, angular) #Car movement
self.car.set_colorful_effect(6, 6, parm=1) #Light strip effect

 

Environmental construction
Voice controlled automatic driving for car line inspection

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
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文