ROS机器人项目开发11例-ROS Robotics Projects(2)语音部分

举报
zhangrelay 发表于 2021/07/15 04:20:09 2021/07/15
3.3k+ 0 0
【摘要】 ROS Robotics Projects(2)语音部分 第三章主要是语音部分,和ROS by examples类似; 这里还是要注意路径问题,还有.py和.launch文件的权限问题; 不需要用sudo,直接用下面语句加权限即可: chmod +x *.py chmod +x *.launch 路径配置参考:   <launch> ...

ROS Robotics Projects(2)语音部分

第三章主要是语音部分,和ROS by examples类似;

这里还是要注意路径问题,还有.py和.launch文件的权限问题;

不需要用sudo,直接用下面语句加权限即可:

chmod +x *.py

chmod +x *.launch

路径配置参考:


      <launch>
     	<param name="aiml_path" value="/home/relaybot/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes/ros_aiml/data" />
     	<node name="aiml_server" pkg="ros_aiml" type="aiml_server.py" output="screen">
     	</node>
     	<include file="$(find sound_play)/soundplay_node.launch"></include>
     	<node name="aiml_tts" pkg="ros_aiml" type="aiml_tts_client.py" output="screen">
     	</node>
     	<node name="aiml_client" pkg="ros_aiml" type="aiml_client.py" output="screen">
     	</node>
      </launch>
  
 

----

命令运行结果:


      relaybot@exbot-ThinkPad-T420s:~/books_ws$ roslaunch ros_aiml start_tts_chat.launch
      ... logging to /home/relaybot/.ros/log/31b69cf6-174d-11e7-85a6-0811968dc4b0/roslaunch-exbot-ThinkPad-T420s-22991.log
      Checking log directory for disk usage. This may take awhile.
      Press Ctrl-C to interrupt
      Done checking log file disk usage. Usage is <1GB.
      started roslaunch server http://exbot-ThinkPad-T420s:41234/
      SUMMARY
      ========
      PARAMETERS
       * /aiml_path: /home/relaybot/bo...
       * /rosdistro: indigo
       * /rosversion: 1.11.21
      NODES
       /
       aiml_client (ros_aiml/aiml_client.py)
       aiml_server (ros_aiml/aiml_server.py)
       aiml_tts (ros_aiml/aiml_tts_client.py)
       soundplay_node (sound_play/soundplay_node.py)
      auto-starting new master
      process[master]: started with pid [23003]
      ROS_MASTER_URI=http://localhost:11311
      setting /run_id to 31b69cf6-174d-11e7-85a6-0811968dc4b0
      process[rosout-1]: started with pid [23016]
      started core service [/rosout]
      process[aiml_server-2]: started with pid [23023]
      process[soundplay_node-3]: started with pid [23027]
      process[aiml_tts-4]: started with pid [23034]
      process[aiml_client-5]: started with pid [23036]
      (gst-plugin-scanner:23045): GStreamer-WARNING **: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgsteglglessink.so': /usr/lib/x86_64-linux-gnu/libgstegl-1.0.so.0: undefined symbol: eglDestroyImageKHR
      /home/relaybot/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes/ros_aiml/data
      Enter your text :> Starting TTS
      [INFO] [WallTime: 1491100599.275978] Starting listening to response
      Loading brain from standard.brn... done (98290 categories in 1.79 seconds)
      Kernel bootstrap completed in 1.79 seconds
      [INFO] [WallTime: 1491100600.147541] Starting ROS AIML Server
      hi
      Enter your text :> [INFO] [WallTime: 1491100605.857921] I heard:: hi
      [INFO] [WallTime: 1491100605.858716] I spoke:: Hi there!
      [INFO] [WallTime: 1491100605.859830] Response ::Hi there!
      ji
      Enter your text :> [INFO] [WallTime: 1491100611.535482] I heard:: ji
      [INFO] [WallTime: 1491100611.536626] I spoke:: Where are you located?
      [INFO] [WallTime: 1491100611.538437] Response ::Where are you located?
      Enter your text :> [INFO] [WallTime: 1491100615.331469] I heard::
      [INFO] [WallTime: 1491100615.332579] I spoke::
      [INFO] [WallTime: 1491100615.334038] Response ::
      Enter your text :> [INFO] [WallTime: 1491100620.908207] I heard::
      [INFO] [WallTime: 1491100620.909390] I spoke::
      [INFO] [WallTime: 1491100620.910688] Response ::
      what is your name
      Enter your text :> [INFO] [WallTime: 1491100628.790155] I heard:: what is your name
      [INFO] [WallTime: 1491100628.791255] I spoke:: My name is Nameless.
      [INFO] [WallTime: 1491100628.792728] Response ::My name is Nameless.
      Do you love ros
      Enter your text :> [INFO] [WallTime: 1491100640.447431] I heard:: Do you love ros
      [INFO] [WallTime: 1491100640.448486] I spoke:: Yes  Nameless loves everyone and everything.
      [INFO] [WallTime: 1491100640.449860] Response ::Yes  Nameless loves everyone and everything
  
 

文件组织如下,所需文件也配置完成:


      relaybot@exbot-ThinkPad-T420s:~/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes$ tree
      .
      ├── audio_common
      │   ├── audio_capture
      │   │   ├── CHANGELOG.rst
      │   │   ├── CMakeLists.txt
      │   │   ├── launch
      │   │   │   ├── capture.launch
      │   │   │   ├── capture_to_file.launch
      │   │   │   └── capture_wave.launch
      │   │   ├── mainpage.dox
      │   │   ├── package.xml
      │   │   └── src
      │   │   └── audio_capture.cpp
      │   ├── audio_common
      │   │   ├── CHANGELOG.rst
      │   │   ├── CMakeLists.txt
      │   │   └── package.xml
      │   ├── audio_common_msgs
      │   │   ├── CHANGELOG.rst
      │   │   ├── CMakeLists.txt
      │   │   ├── mainpage.dox
      │   │   ├── msg
      │   │   │   └── AudioData.msg
      │   │   └── package.xml
      │   ├── audio_play
      │   │   ├── CHANGELOG.rst
      │   │   ├── CMakeLists.txt
      │   │   ├── launch
      │   │   │   └── play.launch
      │   │   ├── mainpage.dox
      │   │   ├── package.xml
      │   │   └── src
      │   │   └── audio_play.cpp
      │   └── sound_play
      │   ├── action
      │   │   └── SoundRequest.action
      │   ├── CHANGELOG.rst
      │   ├── CMakeLists.txt
      │   ├── include
      │   │   └── sound_play
      │   │   └── sound_play.h
      │   ├── mainpage.dox
      │   ├── msg
      │   │   └── SoundRequest.msg
      │   ├── package.xml
      │   ├── README
      │   ├── scripts
      │   │   ├── playbuiltin.py
      │   │   ├── playpackage.py
      │   │   ├── play.py
      │   │   ├── say.py
      │   │   ├── shutup.py
      │   │   ├── soundclient_example.py
      │   │   ├── soundplay_node.py
      │   │   ├── test
      │   │   │   └── test_sound_client.py
      │   │   ├── test_actionlib_client.py
      │   │   └── test.py
      │   ├── setup.py
      │   ├── soundplay_node.launch
      │   ├── sounds
      │   │   ├── BACKINGUP.ogg
      │   │   ├── NEEDS_PLUGGING_BADLY.ogg
      │   │   ├── NEEDS_PLUGGING.ogg
      │   │   ├── NEEDS_UNPLUGGING_BADLY.ogg
      │   │   ├── NEEDS_UNPLUGGING.ogg
      │   │   └── say-beep.wav
      │   ├── src
      │   │   └── sound_play
      │   │   ├── __init__.py
      │   │   ├── libsoundplay.py
      │   │   └── libsoundplay.pyc
      │   ├── test
      │   │   ├── CMakeLists.txt
      │   │   └── test.cpp
      │   └── test.launch
      └── ros_aiml
       ├── CMakeLists.txt
       ├── data
       │   ├── ai.aiml
       │   ├── alice.aiml
       │   ├── astrology.aiml
       │   ├── atomic.aiml
       │   ├── badanswer.aiml
       │   ├── biography.aiml
       │   ├── bot.aiml
       │   ├── bot_profile.aiml
       │   ├── client.aiml
       │   ├── client_profile.aiml
       │   ├── computers.aiml
       │   ├── continuation.aiml
       │   ├── date.aiml
       │   ├── default.aiml
       │   ├── drugs.aiml
       │   ├── emotion.aiml
       │   ├── food.aiml
       │   ├── geography.aiml
       │   ├── gossip.aiml
       │   ├── history.aiml
       │   ├── humor.aiml
       │   ├── imponderables.aiml
       │   ├── inquiry.aiml
       │   ├── interjection.aiml
       │   ├── iu.aiml
       │   ├── junktest.text
       │   ├── knowledge.aiml
       │   ├── literature.aiml
       │   ├── loebner10.aiml
       │   ├── money.aiml
       │   ├── movies.aiml
       │   ├── mp0.aiml
       │   ├── mp1.aiml
       │   ├── mp2.aiml
       │   ├── mp3.aiml
       │   ├── mp4.aiml
       │   ├── mp5.aiml
       │   ├── mp6.aiml
       │   ├── music.aiml
       │   ├── numbers.aiml
       │   ├── personality.aiml
       │   ├── phone.aiml
       │   ├── pickup.aiml
       │   ├── politics.aiml
       │   ├── primeminister.aiml
       │   ├── primitive-math.aiml
       │   ├── psychology.aiml
       │   ├── pyschology.aiml
       │   ├── reduction0.safe.aiml
       │   ├── reduction1.safe.aiml
       │   ├── reduction2.safe.aiml
       │   ├── reduction3.safe.aiml
       │   ├── reduction4.safe.aiml
       │   ├── reduction.names.aiml
       │   ├── reductions-update.aiml
       │   ├── religion.aiml
       │   ├── salutations.aiml
       │   ├── science.aiml
       │   ├── sex.aiml
       │   ├── sports.aiml
       │   ├── stack.aiml
       │   ├── standard.brn
       │   ├── startup.xml
       │   ├── stories.aiml
       │   ├── that.aiml
       │   ├── update1.aiml
       │   ├── update_mccormick.aiml
       │   ├── wallace.aiml
       │   └── xfind.aiml
       ├── launch
       │   ├── start_chat.launch
       │   ├── start_chat.launch~
       │   ├── start_speech_chat.launch
       │   ├── start_speech_chat.launch~
       │   ├── start_tts_chat.launch
       │   └── start_tts_chat.launch~
       ├── package.xml
       └── scripts
       ├── aiml_client.py
       ├── aiml_server.py
       ├── aiml_speech_recog_client.py
       └── aiml_tts_client.py
      25 directories, 135 files
  
 

--End--

文章来源: zhangrelay.blog.csdn.net,作者:zhangrelay,版权归原作者所有,如需转载,请联系作者。

原文链接:zhangrelay.blog.csdn.net/article/details/68951068

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

作者其他文章

评论(0

抱歉,系统识别当前为高风险访问,暂不支持该操作

    全部回复

    上滑加载中

    设置昵称

    在此一键设置昵称,即可参与社区互动!

    *长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

    *长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。