plan_footsteps.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # SVN $HeadURL: https://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/humanoid_navigation/footstep_planner/scripts/plan_footsteps.py $
00004 # SVN $Id: plan_footsteps.py 1862 2011-08-29 16:29:14Z hornunga@informatik.uni-freiburg.de $
00005 
00006 #
00007 # A simple service client calling a running footstep_planner node.
00008 # Using this program you can request footstep plans from the command line.
00009 #
00010 # Author: Armin Hornung, University of Freiburg 
00011 #
00012 # This is program is part of the ROS footstep planner:
00013 # http://www.ros.org/wiki/footstep_planner
00014 # License: GPL 3
00015 #
00016 
00017 import roslib
00018 roslib.load_manifest('footstep_planner')
00019 import rospy
00020 import sys
00021 
00022 from humanoid_nav_msgs.srv import *
00023 from geometry_msgs.msg import Pose2D
00024 
00025 if __name__ == '__main__':
00026     if len(sys.argv) != 7:
00027         sys.exit('\nUSAGE: %s <start> <goal>\n  where <start> and <goal> consist of "x y theta" in world coordinates\n\n' %  sys.argv[0])
00028     
00029     rospy.init_node('plan_footsteps')
00030     planSrv = rospy.ServiceProxy("plan_footsteps", PlanFootsteps)
00031     start = Pose2D()
00032     goal = Pose2D()
00033     
00034     start.x=float(sys.argv[1])
00035     start.y=float(sys.argv[2])
00036     start.theta=float(sys.argv[3])
00037     
00038     goal.x=float(sys.argv[4])
00039     goal.y=float(sys.argv[5])
00040     goal.theta=float(sys.argv[6])
00041     
00042     rospy.loginfo("Calling footstep planner service from (%f %f %f) to (%f %f %f)...", 
00043                   start.x, start.y, start.theta, goal.x, goal.y, goal.theta)
00044     resp = planSrv(start, goal)
00045     
00046     if resp.result == True:
00047         rospy.loginfo("Planning succeeded with %d steps, path costs: %f" % (len(resp.footsteps), resp.costs))
00048     else:
00049         rospy.logerr("Service call failed")
00050     
00051     exit(0)


bipedRobin_footstep_planner
Author(s):
autogenerated on Fri Nov 15 2013 11:11:28