ROS and sounds or how to make your droid to say the Dalek Exterminate!!!

Audio feedback from your robot


After our previous post where Bence explained that roboticists should be careful doing scary stuff with their robot, I thought I need to do some with mine to troll ourselves. So why shouldn’t my robot sound like this when it is moving:



Uncanny valley

Before I jump to the technical details, I would like to ask why do we get scared when a humanoid robot says it will destroy the world?
My opinion is we over-estimate the capabilities of humanoid robots because they look like us. The short explanation to the uncanny valley[1] is, anything that is close to look like human, will make us to believe it is really a human. If it says/do/look good we will think it is cute, if it is says/do/look bad, then it will be creepy.

I would like to recommend two articles in this topic, which explains more of this matter .
Why Are People Afraid of Robots?
We’re Scared of Robots Because We’re Scared of Humans

What can we do to not creep out? Learn more about it! It makes us more comfortable when we don’t have to face with the unknown.
Otherwise in case of robot apocalypse:

Know your paradoxes! Thanks One Girl Geek for the picture
Know your paradoxes! Thanks One Girl Geek for the picture![2]



I wanted to get sound feedback from my robot (and of course to hear some cool effects while doing different jobs), I have decided to buy USB powered speakers and a USB soundcard to easily attach them to my embedded systems.

Sound play

Bence told me I could use the sound play[3] ROS library for playing sounds on my robot.
So I did a

sudo apt-get install ros-indigo-sound-play 

and tried out

odroid@odroid:~$ rosrun sound_play 'Hello world'
Unable to register with master node [http://localhost:11311]: master may not be running yet. Will keep trying.

My bad, in a different terminal I have started the rosmaster


and tried once more

odroid@odroid:~$ rosrun sound_play 'Hello world'
Saying: Hello world
Voice: voice_kal_diphone
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/sound_play/", line 79, in 
    print 'Volume: %s' % volume
NameError: name 'volume' is not defined

Hmm this looks like an issue, lets google on it. Result was
This is a bug[4] so I have to clone out the latest repo where it was fixed.

git clone

After I did a


on my workspace to build the newly cloned out sound play

odroid@odroid:~/hot_wheels/hotwheels_ws$ rosrun sound_play 'Hello world'
Saying: Hello world
Voice: voice_kal_diphone
Volume: 1.0
[WARN] [WallTime: 1460879661.468217] Sound command issued, but no node is subscribed to the topic. Perhaps you forgot to run

Hmm I see, it is time to read the manuals. “The following utilities can be used to play sound when is running. For help on getting running refer to the tutorial.”
Ok lets see the tutorial . I have followed it:

$ rosdep install sound_play
$ rosmake sound_play  
odroid@odroid:~$ cat /proc/asound/cards
 0 [odroidaudio    ]: odroid-audio - odroid-audio
 1 [CameraB409241  ]: USB-Audio - USB Camera-B4.09.24.1
                      OmniVision Technologies, Inc. USB Camera-B4.09.24.1 at
 2 [Device         ]: USB-Audio - PrimeSense Device
                      PrimeSense PrimeSense Device at, high speed
 3 [Device_1       ]: USB-Audio - USB PnP Sound Device
                      USB PnP Sound Device at, full speed

My usb device is the 3rd one. This will be very easy.

odroid@odroid:~/hot_wheels/hotwheels_ws$ asoundconf set-default-card 3
-bash: asoundconf: command not found

Or maybe not… hello google my old friend. I’ve figured out I should not use the Alsa commands, but instead the Pulse audio[5].

odroid@odroid:~/hot_wheels/hotwheels_ws$  pacmd list-sources | grep -e device.string -e 'name:'
                device.string = "0"
                device.string = "3"
                device.string = "hw:3"
                device.string = "hw:1"
                device.string = "front:2"
odroid@odroid:~/hot_wheels/hotwheels_ws$ pacmd set-default-source alsa_input.usb-OmniVision_Technologies__Inc._USB_Camera-B4.09.24.1-01-CameraB409241.analog-4-channel-input
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> odroid@odroid:~/hot_wheels/hotwheels_ws$
odroid@odroid:~/hot_wheels/hotwheels_ws$ pacmd list-sinks | grep -e 'name:' -e 'index'
  * index: 0
    index: 1
odroid@odroid:~/hot_wheels/hotwheels_ws$ pacmd set-default-sink alsa_output.usb-0d8c_USB_PnP_Sound_Device-00-Device_1.analog-stereo
Welcome to PulseAudio! Use "help" for usage information.

I have also started a this in a different terminal:

rosrun sound_play

I hope everything is in place now, let’s see it:

odroid@odroid:~/hot_wheels/hotwheels_ws$ rosrun sound_play "hello world"
Saying: hello world
Voice: voice_kal_diphone
Volume: 1.0

I can hear it, it worked!

Let it be Dalek

Finally at the point where I can play sounds on the robot, I have searched and found the Dalek exterminate audio . I have downloaded and converted to wav format.

rosrun sound_play /home/odroid/Downloads/s1_06_aud_03.wav

Muhahaha one step closer to be evil genius and to take over the world.

Powerup a Madcat

After my short burst of joy caused by the success, I have decided to play one of my childhood memory sound at the startup. Back in my young days I have played with the Mechwarrior 2, this is what I’ve heard a lot of time:

Let it be Madcat!

Whenever the rover starts up ROS I would like to hear the power up sound from the video above . There are at least two ways to achieving it. One is I have to create a ROS node which checks if any other node started to subscribe to the topic for the soundplay (in my case /robotsound). If yes, then plays the sound. Another way (which is the shortest and dirtiest to do it) is to create a script that publish the correct information to the /robotsound topic.

I have choosen the script way to do it, but later I will do a proper solution.

sleep 3
rostopic pub /robotsound sound_play/SoundRequest "{sound: -2,command: 2, volume: 1.0, arg: '/home/odroid/Downloads/mechwstartup.ogg', arg2: ''}"

Also addition to my launch file:

<include file="$(find sound_play)/soundplay_node.launch"/>
<node name="foo" pkg="hotwheels_start" type=""/>

The next step will be to use the microphones on the robot to hear it’s surrounding.



One thought on “ROS and sounds or how to make your droid to say the Dalek Exterminate!!!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s