Go to the documentation of this file.00001
00002 import roslib
00003 roslib.load_manifest('pr2_follow_laser_behavior')
00004
00005 import rospy
00006 import actionlib
00007 from actionlib_msgs.msg import *
00008 from pr2_controllers_msgs.msg import *
00009 from geometry_msgs.msg import *
00010
00011 rospy.init_node('move_the_head', anonymous=True)
00012
00013 client = actionlib.SimpleActionClient(
00014 '/head_traj_controller/point_head_action', PointHeadAction)
00015 client.wait_for_server()
00016
00017 g = PointHeadGoal()
00018 g.target.header.frame_id = 'base_link'
00019
00020 g.target.point.x = 1.
00021 g.target.point.y = 0
00022 g.target.point.z = 1.
00023 g.min_duration = rospy.Duration(1.0)
00024
00025 client.send_goal(g)
00026 client.wait_for_result()
00027
00028 if client.get_state() == GoalStatus.SUCCEEDED:
00029 print "Succeeded"
00030 else:
00031 print "Failed"
00032