00001
00002
00003 import roslib
00004 roslib.load_manifest('cob_sound')
00005 import rospy
00006
00007
00008 import actionlib
00009
00010
00011
00012 from cob_sound.msg import *
00013
00014 def say_client():
00015
00016
00017 client = actionlib.SimpleActionClient('sound_controller/say', SayAction)
00018
00019
00020
00021 client.wait_for_server()
00022
00023
00024 goal = SayGoal()
00025 goal.text.data = "Hello, how are you? I am fine."
00026
00027
00028 client.send_goal(goal)
00029
00030
00031 client.wait_for_result()
00032
00033
00034 return client.get_result()
00035 rospy.loginfo("Say action finished")
00036
00037 if __name__ == '__main__':
00038 try:
00039
00040
00041 rospy.init_node('say_client')
00042 result = say_client()
00043 except rospy.ROSInterruptException:
00044 print "program interrupted before completion"
00045