ros2d2 is a ROS package to make R2D2-like sounds. It is based on the following libraries:
- r2d2-voice to synthesize prametric beep sounds (like whistle)
- ttastromech to transform texts into R2D2 sounds
pip install ttastromech
cd ~/catkin_ws/src
git clone https://github.com/koide3/ros2d2.git
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=Release
You may need to install libasound2-dev:
sudo apt install libasound2-dev
roslaunch ros2d2 ros2d2.launch
# play a preset beep sound
$ rostopic pub /ros2d2_node/preset std_msgs/String "data: 'whistle'"
# generate R2D2 sound from a text
$ rostopic pub /ros2d2_node/speak std_msgs/String "data: 'hello world'"
Audio: whistle, hello world
You can play preset beep sounds synthesized by r2d2-voice. Default preset sounds are; whistle, tonedown, toneup, failure, alert, confuse, and calculate. They are defined by a csv file at ros2d2/data/presets. You can add new sounds by adding commands to the file.
With this topic, you can play R2D2 voice transformed from a text using ttastromech. It makes sound by translating each character in the text to corresponding predefined R2D2 sound.
This is a topic to make sound by directly giving commands to r2d2-voice. See r2d2-voice for the details of the command.
This package is released under GPLv3 as r2d2-voice adopts this license.