Voice control for ROS turtlebot with pocketsphinx
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md update README Mar 20, 2017
ros_voice_control.py First commit Feb 18, 2017
voice_cmd.dic First commit Feb 18, 2017
voice_cmd.kwlist First commit Feb 18, 2017


Voice control for ROS turtlebot with pocketsphinx

The script shows how to control ROS turtlebot with English keywords using pocketsphinx

Compared to an earlier implementation, this one:

  • enables the keyword search mode, which should better filter not needed words
  • uses pocketsphinx-python instead of Gstreamer
  • is really simple (just a script to run)

It was currently tested only for linux and ROS Indigo turtlebot


Install pocketsphinx with dependencies

sudo apt-get install -y python python-dev python-pip build-essential swig libpulse-dev git
sudo pip install pyaudio
sudo pip install pocketsphinx

Install ROS

If you are new to ROS (like me), check this introductory video for ROS installation details

More instructions can be found on ROS website

Running an example

Run turtlebot environment:

roslaunch turtlebot_gazebo turtlebot_world.launch

In a separate terminal run the script:

python ros_voice_control.py

Speak one of the default commands ( forward / move / stop / left / right / back / full speed / half speed )

Using your own keywords

You can run this with any set of words. To do that, you need lexicon and keyword list files (check voice_cmd.dic and voice_cmd.kwlist for details).

Word pronunciations for English can be found in CMUdict

You can also download pocketsphinx acoustic models for several other languages here

Read more about pocketsphinx on the official website: http://cmusphinx.sourceforge.net