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

举报
zhangrelay 发表于 2021/07/15 04:20:09 2021/07/15
【摘要】 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

路径配置参考:

 


  
  1. <launch>
  2. <param name="aiml_path" value="/home/relaybot/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes/ros_aiml/data" />
  3. <node name="aiml_server" pkg="ros_aiml" type="aiml_server.py" output="screen">
  4. </node>
  5. <include file="$(find sound_play)/soundplay_node.launch"></include>
  6. <node name="aiml_tts" pkg="ros_aiml" type="aiml_tts_client.py" output="screen">
  7. </node>
  8. <node name="aiml_client" pkg="ros_aiml" type="aiml_client.py" output="screen">
  9. </node>
  10. </launch>

 

 

 

 

 

----

命令运行结果:

 


  
  1. relaybot@exbot-ThinkPad-T420s:~/books_ws$ roslaunch ros_aiml start_tts_chat.launch
  2. ... logging to /home/relaybot/.ros/log/31b69cf6-174d-11e7-85a6-0811968dc4b0/roslaunch-exbot-ThinkPad-T420s-22991.log
  3. Checking log directory for disk usage. This may take awhile.
  4. Press Ctrl-C to interrupt
  5. Done checking log file disk usage. Usage is <1GB.
  6. started roslaunch server http://exbot-ThinkPad-T420s:41234/
  7. SUMMARY
  8. ========
  9. PARAMETERS
  10. * /aiml_path: /home/relaybot/bo...
  11. * /rosdistro: indigo
  12. * /rosversion: 1.11.21
  13. NODES
  14. /
  15. aiml_client (ros_aiml/aiml_client.py)
  16. aiml_server (ros_aiml/aiml_server.py)
  17. aiml_tts (ros_aiml/aiml_tts_client.py)
  18. soundplay_node (sound_play/soundplay_node.py)
  19. auto-starting new master
  20. process[master]: started with pid [23003]
  21. ROS_MASTER_URI=http://localhost:11311
  22. setting /run_id to 31b69cf6-174d-11e7-85a6-0811968dc4b0
  23. process[rosout-1]: started with pid [23016]
  24. started core service [/rosout]
  25. process[aiml_server-2]: started with pid [23023]
  26. process[soundplay_node-3]: started with pid [23027]
  27. process[aiml_tts-4]: started with pid [23034]
  28. process[aiml_client-5]: started with pid [23036]
  29. (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
  30. /home/relaybot/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes/ros_aiml/data
  31. Enter your text :> Starting TTS
  32. [INFO] [WallTime: 1491100599.275978] Starting listening to response
  33. Loading brain from standard.brn... done (98290 categories in 1.79 seconds)
  34. Kernel bootstrap completed in 1.79 seconds
  35. [INFO] [WallTime: 1491100600.147541] Starting ROS AIML Server
  36. hi
  37. Enter your text :> [INFO] [WallTime: 1491100605.857921] I heard:: hi
  38. [INFO] [WallTime: 1491100605.858716] I spoke:: Hi there!
  39. [INFO] [WallTime: 1491100605.859830] Response ::Hi there!
  40. ji
  41. Enter your text :> [INFO] [WallTime: 1491100611.535482] I heard:: ji
  42. [INFO] [WallTime: 1491100611.536626] I spoke:: Where are you located?
  43. [INFO] [WallTime: 1491100611.538437] Response ::Where are you located?
  44. Enter your text :> [INFO] [WallTime: 1491100615.331469] I heard::
  45. [INFO] [WallTime: 1491100615.332579] I spoke::
  46. [INFO] [WallTime: 1491100615.334038] Response ::
  47. Enter your text :> [INFO] [WallTime: 1491100620.908207] I heard::
  48. [INFO] [WallTime: 1491100620.909390] I spoke::
  49. [INFO] [WallTime: 1491100620.910688] Response ::
  50. what is your name
  51. Enter your text :> [INFO] [WallTime: 1491100628.790155] I heard:: what is your name
  52. [INFO] [WallTime: 1491100628.791255] I spoke:: My name is Nameless.
  53. [INFO] [WallTime: 1491100628.792728] Response ::My name is Nameless.
  54. Do you love ros
  55. Enter your text :> [INFO] [WallTime: 1491100640.447431] I heard:: Do you love ros
  56. [INFO] [WallTime: 1491100640.448486] I spoke:: Yes Nameless loves everyone and everything.
  57. [INFO] [WallTime: 1491100640.449860] Response ::Yes Nameless loves everyone and everything

 

 

 

 

 

 

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

 


  
  1. relaybot@exbot-ThinkPad-T420s:~/books_ws/src/ROS_Robotics_Projects_master/Chapter03/codes$ tree
  2. .
  3. ├── audio_common
  4. │   ├── audio_capture
  5. │   │   ├── CHANGELOG.rst
  6. │   │   ├── CMakeLists.txt
  7. │   │   ├── launch
  8. │   │   │   ├── capture.launch
  9. │   │   │   ├── capture_to_file.launch
  10. │   │   │   └── capture_wave.launch
  11. │   │   ├── mainpage.dox
  12. │   │   ├── package.xml
  13. │   │   └── src
  14. │   │   └── audio_capture.cpp
  15. │   ├── audio_common
  16. │   │   ├── CHANGELOG.rst
  17. │   │   ├── CMakeLists.txt
  18. │   │   └── package.xml
  19. │   ├── audio_common_msgs
  20. │   │   ├── CHANGELOG.rst
  21. │   │   ├── CMakeLists.txt
  22. │   │   ├── mainpage.dox
  23. │   │   ├── msg
  24. │   │   │   └── AudioData.msg
  25. │   │   └── package.xml
  26. │   ├── audio_play
  27. │   │   ├── CHANGELOG.rst
  28. │   │   ├── CMakeLists.txt
  29. │   │   ├── launch
  30. │   │   │   └── play.launch
  31. │   │   ├── mainpage.dox
  32. │   │   ├── package.xml
  33. │   │   └── src
  34. │   │   └── audio_play.cpp
  35. │   └── sound_play
  36. │   ├── action
  37. │   │   └── SoundRequest.action
  38. │   ├── CHANGELOG.rst
  39. │   ├── CMakeLists.txt
  40. │   ├── include
  41. │   │   └── sound_play
  42. │   │   └── sound_play.h
  43. │   ├── mainpage.dox
  44. │   ├── msg
  45. │   │   └── SoundRequest.msg
  46. │   ├── package.xml
  47. │   ├── README
  48. │   ├── scripts
  49. │   │   ├── playbuiltin.py
  50. │   │   ├── playpackage.py
  51. │   │   ├── play.py
  52. │   │   ├── say.py
  53. │   │   ├── shutup.py
  54. │   │   ├── soundclient_example.py
  55. │   │   ├── soundplay_node.py
  56. │   │   ├── test
  57. │   │   │   └── test_sound_client.py
  58. │   │   ├── test_actionlib_client.py
  59. │   │   └── test.py
  60. │   ├── setup.py
  61. │   ├── soundplay_node.launch
  62. │   ├── sounds
  63. │   │   ├── BACKINGUP.ogg
  64. │   │   ├── NEEDS_PLUGGING_BADLY.ogg
  65. │   │   ├── NEEDS_PLUGGING.ogg
  66. │   │   ├── NEEDS_UNPLUGGING_BADLY.ogg
  67. │   │   ├── NEEDS_UNPLUGGING.ogg
  68. │   │   └── say-beep.wav
  69. │   ├── src
  70. │   │   └── sound_play
  71. │   │   ├── __init__.py
  72. │   │   ├── libsoundplay.py
  73. │   │   └── libsoundplay.pyc
  74. │   ├── test
  75. │   │   ├── CMakeLists.txt
  76. │   │   └── test.cpp
  77. │   └── test.launch
  78. └── ros_aiml
  79. ├── CMakeLists.txt
  80. ├── data
  81. │   ├── ai.aiml
  82. │   ├── alice.aiml
  83. │   ├── astrology.aiml
  84. │   ├── atomic.aiml
  85. │   ├── badanswer.aiml
  86. │   ├── biography.aiml
  87. │   ├── bot.aiml
  88. │   ├── bot_profile.aiml
  89. │   ├── client.aiml
  90. │   ├── client_profile.aiml
  91. │   ├── computers.aiml
  92. │   ├── continuation.aiml
  93. │   ├── date.aiml
  94. │   ├── default.aiml
  95. │   ├── drugs.aiml
  96. │   ├── emotion.aiml
  97. │   ├── food.aiml
  98. │   ├── geography.aiml
  99. │   ├── gossip.aiml
  100. │   ├── history.aiml
  101. │   ├── humor.aiml
  102. │   ├── imponderables.aiml
  103. │   ├── inquiry.aiml
  104. │   ├── interjection.aiml
  105. │   ├── iu.aiml
  106. │   ├── junktest.text
  107. │   ├── knowledge.aiml
  108. │   ├── literature.aiml
  109. │   ├── loebner10.aiml
  110. │   ├── money.aiml
  111. │   ├── movies.aiml
  112. │   ├── mp0.aiml
  113. │   ├── mp1.aiml
  114. │   ├── mp2.aiml
  115. │   ├── mp3.aiml
  116. │   ├── mp4.aiml
  117. │   ├── mp5.aiml
  118. │   ├── mp6.aiml
  119. │   ├── music.aiml
  120. │   ├── numbers.aiml
  121. │   ├── personality.aiml
  122. │   ├── phone.aiml
  123. │   ├── pickup.aiml
  124. │   ├── politics.aiml
  125. │   ├── primeminister.aiml
  126. │   ├── primitive-math.aiml
  127. │   ├── psychology.aiml
  128. │   ├── pyschology.aiml
  129. │   ├── reduction0.safe.aiml
  130. │   ├── reduction1.safe.aiml
  131. │   ├── reduction2.safe.aiml
  132. │   ├── reduction3.safe.aiml
  133. │   ├── reduction4.safe.aiml
  134. │   ├── reduction.names.aiml
  135. │   ├── reductions-update.aiml
  136. │   ├── religion.aiml
  137. │   ├── salutations.aiml
  138. │   ├── science.aiml
  139. │   ├── sex.aiml
  140. │   ├── sports.aiml
  141. │   ├── stack.aiml
  142. │   ├── standard.brn
  143. │   ├── startup.xml
  144. │   ├── stories.aiml
  145. │   ├── that.aiml
  146. │   ├── update1.aiml
  147. │   ├── update_mccormick.aiml
  148. │   ├── wallace.aiml
  149. │   └── xfind.aiml
  150. ├── launch
  151. │   ├── start_chat.launch
  152. │   ├── start_chat.launch~
  153. │   ├── start_speech_chat.launch
  154. │   ├── start_speech_chat.launch~
  155. │   ├── start_tts_chat.launch
  156. │   └── start_tts_chat.launch~
  157. ├── package.xml
  158. └── scripts
  159. ├── aiml_client.py
  160. ├── aiml_server.py
  161. ├── aiml_speech_recog_client.py
  162. └── aiml_tts_client.py
  163. 25 directories, 135 files

 

 

 

 

 

--End--

 

 

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

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

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

评论(0

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

全部回复

上滑加载中

设置昵称

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

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

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