ROS kinetic语音识别(转)

1.安装依赖

1.1安装ros-kinetic-audio-common


1

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

1.2 安装libasound2

sudo apt-get install libasound2

1.3 安装libgstreamer0.10

sudo apt-get install gstreamer0.10-*

1.4安装python-gst0.10

sudo apt-get install python-gst0.10

2.安装 libsphinxbase1

下载地址:https://packages.debian.org/jessie/libsphinxbase1

sudo dpkg -i libsphinxbase1_0.8-6_amd64.deb

3. 安装libpocketsphinx1

下载地址:https://packages.debian.org/jessie/libpocketsphinx1

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

4.安装gstreamer0.10-pocketsphinx

下载地址:https://packages.debian.org/jessie/gstreamer0.10-pocketsphinx

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

5.安装pocketsphinx

5.1进入工作空间,git源码

cd ~/dev/catkin_ws/srcgit clone https://github.com/mikeferguson/pocketsphinx

5.2下载英文语音包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

会加压安装到/usr/share/目录如下所示

/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

在包pocketsphinx下面建一个model目录,存放语音模型文件

cd ~/dev/catkin_ws/src/pocketsphinx
mkdir model

将下载好的语音文件,解压后,将其中的model文件下的所有文件拷贝到~/dev/catkin_ws/src/pocketsphinx/model下,也可以不复制。

6 启动pocketsphinx测试

直接运行pocketsphinx启动脚本命令“roslaunch pocketsphinx robocup.launch”会出现如下错误,

为此,首先我对recognizer.py的做了如下修改:

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

这些安装好之后,可以开始测试pocketsphinx的语音识别功能了:

1.终端运行launch启动文件:

roslaunch pocketsphinx robocup.launch

2.尝试说一些简单的语句,(如果使用英文库,说一些数字;如果使用普通话库讲中文),查看识别结果

3.用rostopic echo进行查看识别的输出,即ROS发布的结果消息)

rostopic echo /recognizer/output

7.也可以下载其他包进行测试

中文普通话

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

后期考虑在launch文件中设置参数,在recognizer.py加载参数的读取

参考:http://blog.csdn.net/x_r_su/article/details/53022746?locationNum=1&fps=1

http://www.ncnynl.com/archives/201701/1220.html

原文地址:https://www.cnblogs.com/yunxiaguo/p/8780422.html

时间: 2024-08-09 20:51:23

ROS kinetic语音识别(转)的相关文章

在ubuntu 16.04安装ROS Kinetic

ubuntu16.04 已经发布一个月了,ROS的Kinetic也已经发布,需要了解ROS发行版及支持维护的时间等, 可以参考如下网页:http://wiki.ros.org/Distributions + ubuntu 16.04对中文支持很好,直接支持中文输入,使用体验不错. 安装镜像下载地址:http://www.ubuntu.com/download/desktop 下载后,使用U盘启动安装,安装后设置更新源等,并配置常用的应用. 镜像选择: 2. ROS kinetic安装与使用 参考

Ubuntu 下 ROS Kinetic 的安装

安装环境为 Ubuntu 16.04 配置 Ubuntu 软件仓库 打开"设置"中的"软件和更新" 把 "restricted"."universe" 和 "multiverse" 这三项勾上 勾完后关闭 添加源 [email protected]:~$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -

ubuntu 16.04,ros kinetic 使用husy_gazebo

我当前使用的是ubuntu 16.04,ros kinetic ,Gazebo版本为7.0.protoc需要确保版本为2.6.1,而我当前的为3.4.0,因此需要将系统中的protoc替换为2.6.1版本. controller manager.: git https://github.com/ros-controls/ros_control.git (branch: kinetic-devel) resource_retriever: git https://github.com/ros/re

ROS Kinetic Install on Debian 9

Not Succesed! 1.  配置源$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 2. 下载安装Key$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01F

ros科大讯飞语音识别

转自http://www.ncnynl.com/archives/201611/1069.html ROS入门教程-编写科大讯飞语音SDK的ROS包 说明 ROS软件包xfei_asr是集成自科大讯飞的linux的DEMO 介绍xfei_asr的安装和使用 介绍如何发布文字主题转变成语音播放 介绍如何录音并转变成文字输出,并发布主题 xf-ros说明 @author ncnynl <[email protected]> @time 2016-11-12 @website http://www.

ros科大讯飞语音识别环境配置

以在线命令词识别为例: 链接:http://www.xfyun.cn/sdk/dispatcher 1.下载SDK,解压: 2.在ROS工作空间下创建一个Package: catkin_create_pkg xfei_asr roscpp rospy std_msgs 3.将SDK文件夹中的头文件,即下载的SDK文件夹中include文件夹下的 .h文件拷贝至xfei_asr/include/下: 4.将SDK文件夹中sample/asr_sample中的asr_sample.c文件拷贝至xfe

Roboware Studio 简单使用与调试(ROS kinetic)

基于网址:https://blog.csdn.net/qq_41450811/article/details/80305846 使用过程中进行补充(红色字体),整理如下: 1.新建工作区,选择用户目录下 ,名称 :catkin_ws 2.选择Release , 然后在上面菜单栏ROS点击构建:或者那个小锤子 3.测试ros是否正常运行,运行roscore : 如右上角的加号可以添加终端,因ros使用一个终端是不够的. 4.测试正常~! ctrl + c 取消 5.新建一个包 6.catkin_m

ROS 新手教程 命令汇总

查看环境变量的配置: [email protected]:~$ export | grep ROS declare -x ROSLISP_PACKAGE_DIRECTORIES=""declare -x ROS_DISTRO="kinetic"declare -x ROS_ETC_DIR="/opt/ros/kinetic/etc/ros"declare -x ROS_MASTER_URI="http://localhost:11311

ROS学习(二)—— 配置ROS环境

一.管理环境 p { margin-bottom: 0.25cm; line-height: 120% } a:link { } 如果你在查找和使用ROS软件包方面遇到了问题,请确保你已经正确配置了脚本环境.一个检查的好方法是确保你已经设置了像ROS_ROOT和ROS_PACKAGE_PATH这样的环境变量,可以通过以下命令查看: printenv | grep ROS p { margin-bottom: 0.25cm; line-height: 120% } tt.cjk { font-fa