Robot Operating System (ROS)学习笔记4---语音控制

搭建环境:XMWare  Ubuntu14.04  ROS(indigo)

转载自古月居  转载连接:http://www.guyuehome.com/260

一、语音识别包

1、安装

安装很简单,直接使用ubuntu命令即可,首先安装依赖库:

1 $ sudo apt-get install gstreamer0.10-pocketsphinx
2 $ sudo apt-get install ros-indigo-audio-common
3 $ sudo apt-get install libasound2
安装ROS包:
sudo apt-get install ros-indigo-pocketsphinx

 2、测试

安装完成后我们就可以运行测试了。
        首先,插入你的麦克风设备,然后在系统设置里测试麦克风是否有语音输入。
        然后,运行包中的测试程序:

roslaunch pocketsphinx robocup.launch 

运行后,会出现下面的错误:

1 [recognizer-1] process has died [pid 25379, exit code 1, cmd /opt/ros/indigo/lib/pocketsphinx/recognizer.py __name:=recognizer __log:=/home/l/.ros/log/827f0fd0-2ff1-11e7-90b9-000c296e5c8e/recognizer-1.log].
2 log file: /home/l/.ros/log/827f0fd0-2ff1-11e7-90b9-000c296e5c8e/recognizer-1*.log

纠正上述错误:在终端输入:

sudo apt-get install gstreamer0.10-gconf

注释掉:/opt/ros/indigo/lib/pocketsphinx/recognizer.py

#self.asr.set_property(‘configured‘, True)

2、添加语音库

首先看看例子中要添加的文本信息:

1 $ roscd rbx1_speech/config
2 $ more nav_commands.txt

把下载的文件都解压放在rbx1_speech包的config文件夹下。我们可以给这些文件改个名字:

1 $ roscd rbx1_speech/config
2 $ rename -f ‘s/3026/nav_commands/‘ *

在rbx1_speech/launch文件夹下看看voice_nav_commands.launch这个文件:

1 <launch>
2     <node name="recognizer" pkg="pocketsphinx" type="recognizer.py"
3 output="screen">
4     <param name="lm" value="$(find rbx1_speech)/config/nav_commands.lm"/>
5     <param name="dict" value="$(find rbx1_speech)/config/nav_commands.dic"/>
6     </node>
7 </launch>

通过之前的命令来测试一下效果

1 $ roslaunch rbx1_speech voice_nav_commands.launch
2 $ rostopic echo /recognizer/output 

时间: 2024-08-25 01:53:51

Robot Operating System (ROS)学习笔记4---语音控制的相关文章

Robot Operating System (ROS)学习笔记2---使用smartcar进行仿真

搭建环境:XMWare  Ubuntu14.04  ROS(indigo) 转载自古月居  转载连接:http://www.guyuehome.com/248 一.模型完善 文件夹urdf下,创建gazebo.urdf.xacro.smartcar.urdf.xacro.smartcar_body.urdf.xacro三个文件 1.机器人主体smartcar_body.urdf.xacro文件 1 <?xml version="1.0"?> 2 <robot name

Robot Operating System (ROS)学习笔记---创建简单的机器人模型smartcar

搭建环境:XMWare  Ubuntu14.04  ROS(indigo) 转载自古月居  转载连接:http://www.guyuehome.com/243 一.创建硬件描述包 已创建catkin_ws 打开终端(Ctrl + Alt + T)输入:cd ~/catkin_ws/src 输入:catkin_create_pkg smartcar_description urdf (indigo版) 二.智能车尺寸数据 三.建立urdf文件 在smartcar_description文件夹下创建

ROS是Robot Operating System

ROS是Robot Operating System 机器人操作系统ROS | 简介篇 同样,从个人微信公众号Nao(ID:qRobotics)搬运. 前言 先放一个ROS Industrial一周年剪辑视频. ROS已经发布八周年了,在国外科研机构中非常受欢迎.目前,以美国西南研究院为首的几位大佬开始尝试将ROS应用在工业机器人中,上面这个视频就是ROS-I项目一周年的进展情况. 为了说明讲清楚ROS,我就从ROS是什么,为什么使用ROS,如何使用ROS三个方面展开. △出自今年<机器人视觉与

Learning Roadmap of Robotic Operating System (ROS)

ROS Wiki: http://wiki.ros.org/ Robots Using ROS Textbooks: A Gentle Introduction to ROS Learning ROS for Robotics Programming 1st Edition [pdf] [code] [ros wiki] 2nd Edition [code] [wiki] [online reading] Blog / Tutorial ROS 101: INTRO TO THE ROBOT O

Linux System Programming 学习笔记(七) 线程

1. Threading is the creation and management of multiple units of execution within a single process 二进制文件是驻留在存储介质上,已被编译成操作系统可以使用,准备执行但没有正运行的休眠程序 进程是操作系统对 正在执行中的二进制文件的抽象:已加载的二进制.虚拟内存.内核资源 线程是进程内的执行单元 processes are running binaries, threads are the smal

Linux System Programming 学习笔记(八) 文件和目录管理

1. 文件和元数据 每个文件都是通过inode引用,每个inode索引节点都具有文件系统中唯一的inode number 一个inode索引节点是存储在Linux文件系统的磁盘介质上的物理对象,也是LInux内核通过数据结构表示的实体 inode存储相关联文件的元数据 ls -i 命令获取文件的inode number /* obtaining the metadata of a file */ #include <sys/types.h> #include <sys/stat.h>

Linux System Programming 学习笔记(十) 信号

1. 信号是软中断,提供处理异步事件的机制 异步事件可以是来源于系统外部(例如用户输入Ctrl-C)也可以来源于系统内(例如除0) 内核使用以下三种方法之一来处理信号: (1) 忽略该信号.SIGKILL和SIGSTOP不能被忽略. (2) 捕捉并且处理该信号.The kernel will suspend execution of the process's current code path and jump to a previously registered function. SIGK

Linux System Programming 学习笔记(五) 进程管理

1. 进程是unix系统中两个最重要的基础抽象之一(另一个是文件) A process is a running program A thread is the unit of activity inside of a process the virtualization of memory is associated with the process, the threads all share the same memory address space 2. pid The idle pro

Linux System Programming 学习笔记(九) 内存管理

1. 进程地址空间 Linux中,进程并不是直接操作物理内存地址,而是每个进程关联一个虚拟地址空间 内存页是memory management unit (MMU) 可以管理的最小地址单元 机器的体系结构决定了内存页大小,32位系统通常是 4KB, 64位系统通常是 8KB 内存页分为 valid or invalid: A valid page is associated with an actual page of data,例如RAM或者磁盘上的文件 An invalid page is