Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('planner_msgs')
00004 import rospy
00005 import time
00006
00007 import actionlib
00008 from geometry_msgs.msg import Pose2D
00009 from planner_msgs.msg import goal, GoToGoal, GoToAction
00010
00011
00012
00013 def purepursuit_client():
00014
00015
00016 client = actionlib.SimpleActionClient('purepursuit_planner', GoToAction)
00017
00018
00019 client.wait_for_server()
00020
00021 g = GoToGoal(target = [goal(pose = Pose2D(-2.0, 0.86, 0.0), speed = 0.2), goal(pose = Pose2D(-1.0, 0.46, 0.0), speed = 0.2),
00022 goal(pose = Pose2D(0.0, 0.0, 0.0), speed = 0.2), goal(pose = Pose2D(1.0, 0.0, 0.0), speed = 0.2), goal(pose = Pose2D(2.54, 1.0, 0.0), speed = 0.2),
00023 goal(pose = Pose2D(4.96, 2.18, 0.0), speed = 0.2), goal(pose = Pose2D(8.54, 2.22, 0.0), speed = 0.2)])
00024
00025 rospy.loginfo('Sending goal')
00026
00027 client.send_goal(g)
00028
00029
00030
00031
00032
00033 client.wait_for_result()
00034
00035
00036 return client.get_result()
00037
00038 if __name__ == '__main__':
00039 try:
00040
00041
00042 rospy.init_node('planner_test_client')
00043 result = purepursuit_client()
00044 rospy.loginfo( 'Result: %d'%(result.route_result))
00045 except rospy.ROSInterruptException:
00046 print "program interrupted before completion"