-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f14105
commit a169858
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /usr/bin/env python | ||
|
||
import rospy | ||
import mary_tts.srv | ||
|
||
class IdleBehaviour(object): | ||
# create messages that are used to publish feedback/result | ||
|
||
def __init__(self, name): | ||
# Variables | ||
self._action_name = name | ||
|
||
#Getting parameters | ||
self.locale = rospy.get_param("~speak_locale", "de") | ||
self.voice = rospy.get_param("~speak_voice", "dfki-pavoque-neutral-hsmm") | ||
|
||
self.setVoice() | ||
|
||
def setVoice(self): | ||
rospy.wait_for_service('ros_mary/set_locale') | ||
rospy.wait_for_service('ros_mary/set_voice') | ||
try: | ||
set_locale = rospy.ServiceProxy('ros_mary/set_locale', mary_tts.srv.SetLocale) | ||
set_voice = rospy.ServiceProxy('ros_mary/set_voice', mary_tts.srv.SetVoice) | ||
set_locale(self.locale) | ||
set_voice(self.voice) | ||
return | ||
except rospy.ServiceException, e: | ||
rospy.logerr("Service call failed: %s",e) | ||
|
||
if __name__ == '__main__': | ||
rospy.init_node('set_voice') | ||
IdleBehaviour(rospy.get_name()) | ||
|