18 roslib.load_manifest(
'footstep_planner')
22 from geometry_msgs.msg
import Pose2D
27 if __name__ ==
'__main__':
28 if len(sys.argv) != 7:
29 sys.exit(
'\nUSAGE: %s <start> <goal>\n where <start> and <goal> consist of "x y theta" in world coordinates\n\n' % sys.argv[0])
31 rospy.init_node(
'plan_footsteps')
32 planSrv = rospy.ServiceProxy(
"plan_footsteps", PlanFootsteps)
36 start.x = float(sys.argv[1])
37 start.y = float(sys.argv[2])
38 start.theta = float(sys.argv[3])
40 goal.x = float(sys.argv[4])
41 goal.y = float(sys.argv[5])
42 goal.theta = float(sys.argv[6])
44 rospy.loginfo(
"Calling footstep planner service from (%f %f %f) to (%f %f %f)...",
45 start.x, start.y, start.theta, goal.x, goal.y, goal.theta)
48 if resp.result ==
True:
49 rospy.loginfo(
"Planning succeeded with %d steps, path costs: %f" % (len(resp.footsteps), resp.costs))
51 rospy.logerr(
"Service call failed")