ROS机器语音

语音识别功能包:pocketsphinx
 由于pocketsphinx只支持到Ubuntu14.04,ROS Kinetic不支持 sudo apt-get install ros-kinetic-pocketsphinx,所以在kinetic安装时比较麻烦一点。

切换为bash:

exec bash 

切换为zsh:

exec zsh

1,安装依赖 ros-kinetic-audio-common

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

2,安装依赖 libasound2

sudo apt-get install libasound2

3,安装依赖 libgstreamer0.10

zsh无法运行,但是bash可以,这里要将bash添加到zsh中

sudo apt-get install gstreamer0.10-*

4,安装依赖 python-gst0.10

sudo apt-get install python-gst0.10

5,安装功能包 libsphinxbase1_0.8-6

下载链接:https://packages.debian.org/jessie/libpocketsphinx1

sudo dpkg -i libpocketsphinx1_0.8-5_amd64.deb

6,安装功能包 libpocketsphinx1_0.8-5

下载链接:https://packages.debian.org/jessie/libpocketsphinx1

sudo dpkg -i libpocketsphinx1_0.8-5_amd64.deb

7,安装功能包 gstreamer0.10-pocketsphinx

下载链接:https://packages.debian.org/jessie/gstreamer0.10-pocketsphinx

sudo dpkg -i gstreamer0.10-pocketsphinx_0.8-5_amd64.deb

8,进入工作空间目录,下载 pocketsphinx 功能包的源码并编译

cd ~/catkin_ws/src
git clone https://github.com/mikeferguson/pocketsphinx
cd ~/catkin_ws/
catkin_make
source devel/setup.bash

9,下载并安装英文语音包pocketsphinx-hmm-en-tidigits_0.8-5

下载链接:https://packages.debian.org/jessie/pocketsphinx-hmm-en-tidigits

sudo dpkg -i pocketsphinx-hmm-en-tidigits_0.8-5_all.deb

10,在 pocketsphinx 包里创建一个 model 目录,存放解压的语音模型文件

cd ~/catkin_ws/src/pocketsphinx
mkdir model
sudo cp /usr/share/pocketsphinx/model/* ~/catkin_ws/src/pocketsphinx/model -r

11,修改 recognizer.py 文件 cd ~/catkin_ws/src/pocketsphinx/nodes

(1)注释掉 self.asr.set_property(‘configured’, True)
(2)添加lm,dict,hmm支持英语识别(如果是其他语言可以改为别的路径)

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')

你可能感兴趣的:(ROS学习过程,linux,运维,服务器)