Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('iri_place')
00004 import rospy
00005
00006
00007 import actionlib
00008
00009
00010
00011
00012
00013 from object_manipulation_msgs.msg import PlaceAction,PlaceGoal
00014 from geometry_msgs.msg import PoseStamped
00015 from math import sqrt
00016
00017 def place_client():
00018
00019
00020 client = actionlib.SimpleActionClient('/iri_place/place', PlaceAction)
00021
00022 print "waiting action server"
00023
00024
00025 client.wait_for_server()
00026
00027
00028 goal = PlaceGoal()
00029
00030 place_location = PoseStamped()
00031 place_location.header.frame_id = "/wam_link0"
00032 place_location.pose.position.x = 0.45;
00033 place_location.pose.position.y = 0;
00034 place_location.pose.position.z = 0;
00035 place_location.pose.orientation.x = sqrt(2)/2;
00036 place_location.pose.orientation.y = sqrt(2)/2;
00037 place_location.pose.orientation.z = 0;
00038 place_location.pose.orientation.w = 0;
00039
00040 goal.place_locations.append(place_location);
00041
00042 print "send goal"
00043
00044 client.send_goal(goal)
00045
00046 print "wait result"
00047
00048 client.wait_for_result()
00049
00050 print "returning result"
00051
00052 return client.get_result()
00053
00054 if __name__ == '__main__':
00055 try:
00056
00057
00058 rospy.init_node('place_check')
00059 result = place_client()
00060 print "Result: ",result
00061 except rospy.ROSInterruptException:
00062 print "program interrupted before completion"
00063