Home » ROS与传感器教程 » ROS与传感器教程-Respeaker语音模块

ROS与传感器教程-Respeaker语音模块

说明:

  • 介绍如何使用Respeaker语音模块

步骤:

  • 安装audio-common和相关依赖库
sudo apt-get install ros-kinetic-audio-common
sudo apt-get install libasound2
sudo apt-get install mplayer
  • 创建catkin工作空间
mkdir -p ~/catkin_ws/src
cd ~catkin_ws/src
catkin_make
  • 将远程库中的代码克隆下来
cd ~/catkin_ws/src
git clone https://github.com/furushchev/respeaker_ros.git
  • 安装缺失的依赖项
cd ..
rosdep install --from-paths src -i -r -n -y
  • 对respeaker麦克风提供外部设备许可
roscd respeaker_ros
sudo cp -f $(rospack find respeaker_ros)/config/60-respeaker.rules /etc/udev/rules.d/60-respeaker.rules
sudo systemctl restart udev
  • 安装python包的依赖
roscd respeaker_ros
sudo pip install -r requirements.txt
  • 更新firmware以实现对底层设备的控制,从远程仓库中可以获取到相应的包
git clone https://github.com/respeaker/usb_4_mic_array.git
cd usb_4_mic_array
sudo python dfu.py --download 6_channels_firmware.bin  # The 6 channels version 
  • 运行sound_play节点
roslaunch sound_play soundplay_node.launch
  • 运行respeaker程序包
roslaunch respeaker_ros respeaker.launch

process[respeaker_node-1]: started with pid [11267]
process[static_transformer-2]: started with pid [11269]
process[speech_to_text-3]: started with pid [11282]
[INFO] [1623723687.040805]: Initializing Respeaker device
[INFO] [1623723761.165163]: Respeaker device initialized (Version: 16)
[INFO] [1623723762.641870]: Found 2: ReSpeaker 4 Mic Array (UAC1.0): USB Audio (hw:1,0) (channels: 6)
[INFO] [1623723762.642348]: Using channels [0, 1, 2, 3, 4, 5]
[INFO] [1623723770.416170]: Speech detected for 2.024 seconds
  • 查看话题
rostopic list

/audio
/audio/channel0
/audio/channel1
/audio/channel2
/audio/channel3
/audio/channel4
/audio/channel5
/diagnostics
/is_speeching
/respeaker_node/parameter_descriptions
/respeaker_node/parameter_updates
/robotsound
/rosout
/rosout_agg
/sound_direction
/sound_localization
/sound_play/cancel
/sound_play/feedback
/sound_play/goal
/sound_play/result
/sound_play/status
/speech_audio
/speech_to_text
/status_led
/tf
  • 通过发布在rostopic上的消息获得诸如声源位置角度等信息
rostopic echo /sound_location


data: 36
---
data: 37
---
data: 40
---
data: 39
---
data: 37
---
data: 40
---
data: 40

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: none