86Hexapod with Speech Recognition

Origin of the project

This project originated from the extension of the 86 small hexapod project.
"There's a voice recognizer on the ROS!" Sayer99 says.
Sayer99 had a flash of inspiration: "Huh? If you add this identifier to the robot,
Isn't it okay to use what you say to control the robot?"
Then Sayer99 started the project.


 Feature description 

This project uses pocketsphinx, a speech recognition package onROS (Robot Operating System), to create a voice-controlled 86-foot hexapod.


 Preparation materials 

  1.  An 86 small hexapod 
  2. A computer with ROS installed, the ROS version installed in this article is ROS Hydro Medusa
  3. Microphone, which can be connected to a computer for audio broadcasting, and if you are using a laptop with a built-in microphone, you do not need to prepare this additional item
  4. ESP8266, it is used to allow Little Six to communicate with RAOS on the computer through WiFi

Environmental erection

Install pocketsphinx package

The first step is to install pocketsphinx, a speech recognition suite, in ROS, so that the computer can complete the speech recognition and pass the result to the little six legs through a string, and then the little six legs decide what kind of actions to do through this string. Here are the steps to install PocketSphinx:

1

2

3

4

sudo apt-get install gstreamer0.10-pocketsphinx

sudo apt-get install ros-hydro-pocketsphinx

sudo apt-get install ros-hydro-audio-common

sudo apt-get install libasound2

Test speech recognition

The pocketsphinx package contains a node recognizer.py that handles audio ingestion and recognition, and posts the identified results to the /recognizer/output topic as std_msgs/string. After the installation, let's do a simple test, connect the computer to the microphone, and execute:

1

roslaunch pocketsphinx robocup.launch

Then try to say some of the words set in the robocup, such as bring me the glass, go to the kitchen, come with me, etc., and if it goes well, you will see the results in the window.


Vocabulary production

Because recognizer.py compares the results of audio analysis with a font, and then selects the closest result from the font as the identification result, such as the above example, the word used is designed by someone else for robocup. Therefore, it is very necessary to customize the font, after all, if you only need a few simple commands, using too large a range of fonts will reduce the success rate of recognition, and you can achieve the best results by formulating the font according to your own needs. The way to create is very simple, first add a text file, for example, hexapod_command.txt, and then enter the words you need, for example: .

stop
move forward
move backward
move left
move right
half speed
full speed

Once done, use the online CMU language model(lm) tool to convert hexapod_command.txt to .dic and .lm files for recognizer.py to use as parameters. After downloading the file generated by the web page, put it in a folder of your choice, and then add a launch file:.

1

2

3

4

5

6

<launch>

  <node name="recognizer" pkg="pocketsphinx" type="recognizer.py" output="screen">

    <param name="lm" value="PATH OF HEXAPOD_COMMAND/hexapod_command.lm"/>

    <param name="idct" value="PATH OF HEXAPOD_COMMAND/hexapod_command.dic"/>

  </node>

</launch>

After executing this launch file, the recognizer can use the contents of the hexapod_command.txt to identify it!


Motion control

This action uses the walking action of the 86ME Mk-II default project 86Hexapod.rbm, which can be found in C:\ProgramData\86ME\examples.
After starting the project, remember to fine-tune its offset value according to each 86 small hexapod, which can correct some small errors on the server.

In terms of hardware configuration, it is 86Hexapod + ESP8266, through  Rosserial86 to connect with ROS, the control program is modified by the small hexapod control program generated by 86ME, and the word string in /recognizer/output is used to use a callback function, and then let the program determine which action to trigger, so that the voice-activated small hexapod (example), remember setup() The relevant settings of wifi should be modified to suit your own environment.


Presentation of achievements

— DEMO VIDEO —


References

[1] R. Patrick Goebel. ROS By Example, vol. 1, ch. 9.


The main page of the self-built amusement park

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.