Book Image

Learning Robotics using Python

Book Image

Learning Robotics using Python

Overview of this book

Table of Contents (19 chapters)
Learning Robotics Using Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with speech synthesis in ROS Indigo and Python


In ROS, there are some ROS packages that perform speech synthesis. Here, we will discuss one ROS package. This package uses Festival as the backend. The package name is sound_play. It has nodes and launch scripts that enable speech synthesis. We need to perform the following steps for speech synthesis:

  1. We can install the sound_play package using the following command:

    $ sudo apt-get install ros-indigo-sound-play
    
  2. After the installation of package, we have to create a sample ROS package to interact with the sound-play node. The following is the command to create a sample package in ROS with the sound-play package as dependency:

    $ catkin_create_pkg sample_tts rospy roscpp sound_play std_msgs
    
  3. We have to create a sound_play python client code for sending text to sound play server node. This client will send the text that needs to be converted to speech to the sound_play server node. The client will send the text to convert to speech in a Topic...