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

4、Voice controlled car color tracking

4、Voice controlled car color tracking

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
yellow following72OK, I found the yellow
red following73OK, I found the red
green following 74OK, I found the green
follow this color75OK, I found this color
stop following76OK, it has been stoped

1、Program startup

Terminal input,

roslaunch yahboomcar_voice_ctrl voice_ctrl_colorTracker.launch
python ~/driver_ws/src/yahboomcar_voice_ctrl/scripts/voice_Ctrl_color_tracker.py

image-20230530193003310

After the program starts, call "Hi Yahboom" to ROSMASTER to wake up the module. When it broadcasts "Hi , I'm here.", it indicates that the module is awakened. Taking tracking red as an example, next you can say "Sred following" to ROSMASTER, and ROSMASTER will broadcast "OK, I found the red ". Then, we release the control of ROSMASTER by pressing the R2 button on the handle, and ROSMASTER starts tracking red. If there is no remote control, you can also enter the following command through the terminal,

xxxxxxxxxx
rostopic pub /JoyState std_msgs/Bool False

2、Core code

code path:~/driver_ws/src/yahboomcar_voice_ctrl/yahboomcar_voice_ctrl/Voice_Ctrl_colorHSV.py

Mainly parsing voice commands and loading HSVs_ The value of range

x
#Determine voice commands and load corresponding HSVs_ Range value
command_result = self.spe.speech_read()
self.spe.void_write(command_result)
if command_result == 73 :
    self.model = "color_follow_line"
    print("tracker red")
    self.hsv_range = [(20, 215, 111), (180, 253, 255)]
    self.dyn_update = True
    elif command_result == 74 :
    self.model = "color_follow_line"
    print("tracker green")
    self.hsv_range = [(44, 138, 91), (84, 255, 255)]
    self.dyn_update = True
#According to hsv_ The value of range, calculating the coordinates of the center of the circle 
rgb_img, binary, self.circle = self.color.object_follow(rgb_img,self.hsv_range)
#Publish the values of the center coordinates based on the coordinate values of the center of the circle
if self.circle[2] != 0: threading.Thread(target=self.execute, args=(self.circle[0], self.circle[1],self.circle[2])).start()
def execute(self, x, y, z):
    position = Position()
    position.angleX = x
    position.angleY = y
    position.distance = z
    self.pub_position.publish(position)
#With the coordinates of the center of the circle and the distance information obtained by the depth camera, the speed is calculated based on the PID. This part of the reference code will not be analyzed here

 

Voice controlled automatic driving for car line inspection
Voice controlled multi-point navigation

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/中文