1. Installation dependencies
1.1 Installing Ros-kinetic-audio-common
1 |
sudo apt- get install ros-kinetic-audio-common |
1.2 Installing Libasound2
sudo apt-get install Libasound2
1.3 Installing libgstreamer0.10
sudo apt-get install gstreamer0.10-*
1.4 Installing python-gst0.10
sudo apt-get install python-gst0.10
2. Installing LIBSPHINXBASE1
: Https://packages.debian.org/jessie/libsphinxbase1
sudo dpkg-i libsphinxbase1_0.8-6_amd64.deb
3. Installing LIBPOCKETSPHINX1
: https://packages.debian.org/jessie/libpocketsphinx1
4. Installing Gstreamer0.10-pocketsphinx
: Https://packages.debian.org/jessie/gstreamer0.10-pocketsphinx
sudo dpkg-i gstreamer0.10-pocketsphinx_0.8-5_amd64.deb
5. Installing Pocketsphinx
5.1 Enter the workspace, git source
CD ~/DEV/CATKIN_WS/SRC
git clone Https://github.com/mikeferguson/pocketsphinx
5.2 Download English Voice pack pocketsphinx-hmm-en-tidigits (0.8-5)
Download the website: https://packages.debian.org/jessie/pocketsphinx-hmm-en-tidigits
sudo dpkg-i pocketsphinx-hmm-en-tidigits_0.8-5_all.deb
will be pressurized installed into the/usr/share/directory as shown below
/usr/share/doc/pocketsphinx-hmm-en-tidigits/changelog. debian.gz/usr/share/doc/pocketsphinx-hmm-en-tidigits/changelog.gz/usr/share/doc/pocketsphinx-hmm-en-tidigits/ copyright/usr/share/pocketsphinx/model/hmm/en/tidigits/feat.params/usr/share/pocketsphinx/model/hmm/en/ tidigits/mdef/usr/share/pocketsphinx/model/hmm/en/tidigits/means/usr/share/pocketsphinx/model/hmm/en/tidigits/ sendump/usr/share/pocketsphinx/model/hmm/en/tidigits/transition_matrices/usr/share/pocketsphinx/model/hmm/en/ Tidigits/variances/usr/share/pocketsphinx/model/lm/en/tidigits. Dmp/usr/share/pocketsphinx/model/lm/en/tidigits.dic/usr/share/pocketsphinx/model/lm/en/tidigits.fsg
Build a model directory below the package Pocketsphinx to store the Voice model file
CD ~/dev/catkin_ws/src/pocketsphinxmkdir model
Will download the good voice file, after decompression, the model file in which all the files under the ~/dev/catkin_ws/src/pocketsphinx/model, can also not copy.
6 Starting the Pocketsphinx test
The following error occurs when you run the Pocketsphinx startup script command "Roslaunch Pocketsphinx robocup.launch" directly.
To do this, I first made the following changes to recognizer.py:
1) Comment out Self.asr.set_property (' configured ', True)
2) Add LM,DICT,HMM support English recognition (if other languages (such as Mandarin) can be changed to a different path)
Self.asr.set_property (' lm ', '/usr/share/pocketsphinx/model/lm/en/tidigits. DMP ') self.asr.set_property (' Dict ', '/usr/share/pocketsphinx/model/lm/en/tidigits.dic ') self.asr.set_property (' Hmm ', '/usr/share/pocketsphinx/model/hmm/en/tidigits ')
Once these are installed, you can start testing the Pocketsphinx speech recognition feature:
1. Terminal Run launch Boot file:
Roslaunch Pocketsphinx Robocup.launch
2. Try to say some simple statements, (if you use the English library, say some numbers; If you use the Mandarin Library to speak Chinese), see the recognition results
3. Use rostopic echo to view the identified output, which is the result message released by Ros)
Rostopic Echo/recognizer/output
7. You can also download other packages for testing
Mandarin Chinese
Pocketsphinx-hmm-zh-tdt HTTPS://PACKAGES.DEBIAN.ORG/JESSIE/POCKETSPHINX-HMM-ZH-TDT
Pocketsphinx-lm-zh-hans-gigatdt HTTPS://PACKAGES.DEBIAN.ORG/JESSIE/POCKETSPHINX-LM-ZH-HANS-GIGATDT
Later consider setting parameters in the launch file, reading the parameters in the recognizer.py load
Reference: Http://blog.csdn.net/x_r_su/article/details/53022746?locationNum=1&fps=1
Http://www.ncnynl.com/archives/201701/1220.html
ROS Kinetic speech Recognition (RPM)