face_detector_action_client.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 import roslib; roslib.load_manifest('face_detector')
4 import rospy
5 
6 # Brings in the SimpleActionClient
7 import actionlib
8 
9 # Brings in the messages used by the face_detector action, including the
10 # goal message and the result message.
11 import face_detector.msg
12 
14  # Creates the SimpleActionClient, passing the type of the action to the constructor.
15  client = actionlib.SimpleActionClient('face_detector_action', face_detector.msg.FaceDetectorAction)
16 
17  # Waits until the action server has started up and started
18  # listening for goals.
19  client.wait_for_server()
20 
21  # Creates a goal to send to the action server.
22  goal = face_detector.msg.FaceDetectorGoal()
23 
24  # Sends the goal to the action server.
25  client.send_goal(goal)
26 
27  # Waits for the server to finish performing the action.
28  client.wait_for_result()
29 
30  # Prints out the result of executing the action
31  return client.get_result() # A FibonacciResult
32 
33 if __name__ == '__main__':
34  try:
35  # Initializes a rospy node so that the SimpleActionClient can
36  # publish and subscribe over ROS.
37  rospy.init_node('face_detector_action_client')
39  print "Done action"
40  except rospy.ROSInterruptException:
41  print "Program interrupted before completion"


face_detector
Author(s): Caroline Pantofaru
autogenerated on Fri Jun 7 2019 22:07:47