The start_speech_chat.launch launch file will start the AIML server, AIML TTS node, and speech recognition node:
<launch> <param name="aiml_path" value="/home/robot/ros_robotics_projects_ws/src/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_speech_recog" pkg="ros_aiml" type="aiml_speech_recog_client.py" output="screen"> </node> </launch>
After creating the launch file, change its permission using the following command:
$ sudo chmod +x *.launch
Use the following command to start interacting with the AIML interpreter:
$ roslaunch ros_aiml start_chat.launch
We can use the following command to start interacting with the AIML interpreter. The response will be converted to speech as well:
$ roslaunch ros_aiml start_tts_chat.launch
The following command will enable speech recognition and TTS:
$ roslaunch ros_aiml start_speech_chat.launch
If you set up the pocketsphinx package for speech recognition, you can run it using the following command:
$ roslaunch pocketsphinx robotcup.launch
![](http://imgdetail.ebookreading.net/hardware/2/9781788627436/9781788627436__ros-programming-building__9781788627436__assets__9c59fd80-284a-4047-bb2e-e910c0f54b5c.png)
Figure 7: Output of the start_speech_chat launch file
Here are the topics generated when we run this launch file:
![](http://imgdetail.ebookreading.net/hardware/2/9781788627436/9781788627436__ros-programming-building__9781788627436__assets__28b0b435-1a36-4a98-8991-3cd2a8ed0185.png)
Figure 8: List of ROS topics
We can test the entire system without the speech recognition system too. You can manually publish the string to the /recognizer/output topic, as shown here:
![](http://imgdetail.ebookreading.net/hardware/2/9781788627436/9781788627436__ros-programming-building__9781788627436__assets__f1ab877a-72d0-46f8-95fa-2605634380c4.png)
Figure 9: Manually publishing input to speech topic