为ROS 配置pocketshpinx

电脑配置

Ubuntu16.04+ROS Kinetic

 

具体工作

1. 前期准备

sudo apt-get install -y python python-dev python-pip build-essential swig libpulse-dev git

sudo pip install pyaudio

sudo pip install pocketsphinx

2. 克隆文件

mkdir -p sphinx

cd shpinx

mkdir -p src

cd src

git clone https://github.com/gorinars/ros_voice_control.git

roslaunch turtlebot_gazebo turtlebot_world.launch

cd ros_voice_control

python ros_voice_control.py

可以念基本的forward/move/stop/left/right等等。

用下面这条指令查看改字典内容

more voice_cmd.dic

此前可能需要配置发音模型,可以从这里下载:

https://download.csdn.net/download/davidietop/11022992

官网发音模型下载(可能比较卡):

https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/

另外,可以下载Pankaj的ros-pocketsphinx包

在src文件夹

git clone https://github.com/cmusphinx/ros-pocketsphinx.git

cd  ..

catkin_make

里面的包自己探索

可能出现的问题

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
参考下面这个链接

https://blog.csdn.net/Davidietop/article/details/88621753

sudo apt-get install portaudio19-dev

或者尝试

sudo apt-get install libportaudio-dev

 

 

参考资料

https://github.com/cmusphinx/ros-pocketsphinx

https://github.com/gorinars/ros_voice_control.git

https://blog.csdn.net/x_r_su/article/details/53022746

 

你可能感兴趣的:(ROS配置法)