test_client.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004 #
00005 # Licensed under the Apache License, Version 2.0 (the "License");
00006 # you may not use this file except in compliance with the License.
00007 # You may obtain a copy of the License at
00008 #
00009 #   http://www.apache.org/licenses/LICENSE-2.0
00010 #
00011 # Unless required by applicable law or agreed to in writing, software
00012 # distributed under the License is distributed on an "AS IS" BASIS,
00013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 # See the License for the specific language governing permissions and
00015 # limitations under the License.
00016 
00017 
00018 import rospy
00019 import actionlib
00020 from cob_sound.msg import *
00021 
00022 def say_client():
00023         client = actionlib.SimpleActionClient('say', SayAction)
00024         client.wait_for_server()
00025 
00026         # Creates a goal to send to the action server.
00027         goal = SayGoal()
00028         goal.text = "Hello, how are you? I am fine."
00029 
00030         # Sends the goal to the action server.
00031         client.send_goal(goal)
00032 
00033         # Waits for the server to finish performing the action.
00034         client.wait_for_result()
00035 
00036         # Prints out the result of executing the action
00037         return client.get_result()
00038         rospy.loginfo("Say action finished")
00039 
00040 if __name__ == '__main__':
00041         try:
00042                 rospy.init_node('say_client')
00043                 result = say_client()
00044         except rospy.ROSInterruptException:
00045                 print "program interrupted before completion"
00046 


cob_sound
Author(s): Florian Weisshardt, Benjamin Maidel
autogenerated on Sat Jun 8 2019 21:02:24