00001
00002
00003 import roslib; roslib.load_manifest('pr2_handy_tools')
00004 import rospy
00005 import actionlib
00006 from pr2_controllers_msgs.msg import PointHeadAction, PointHeadGoal
00007 from object_manipulator.convert_functions import *
00008 from geometry_msgs.msg import *
00009
00010
00011
00012
00013 def point_head():
00014 client = actionlib.SimpleActionClient('/head_traj_controller/point_head_action', PointHeadAction)
00015
00016
00017
00018 client.wait_for_server()
00019
00020
00021 point = [0., 0, 0]
00022 point_frame = '/l_wrist_roll_link'
00023 axis = [1, 0, 0]
00024 axis_frame = '/high_def_frame'
00025 point_head_goal = PointHeadGoal()
00026 point_head_goal.target = create_point_stamped(point, point_frame)
00027 point_head_goal.pointing_frame = axis_frame
00028 point_head_goal.pointing_axis = Vector3(*axis)
00029 point_head_goal.max_velocity = 1.0
00030
00031 print"Pointing",axis_frame, pplist(axis), "at", point_frame, pplist(point)
00032
00033 client.send_goal(point_head_goal)
00034
00035
00036 client.wait_for_result()
00037
00038
00039 if __name__ == '__main__':
00040 rospy.init_node('point_head_test')
00041 point_head()
00042
00043