plan_footsteps.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # SVN $HeadURL: http://alufr-ros-pkg.googlecode.com/svn/trunk/humanoid_stacks/humanoid_navigation/footstep_planner/scripts/plan_footsteps.py $
4 # SVN $Id: plan_footsteps.py 3810 2013-01-20 18:57:24Z garimort@informatik.uni-freiburg.de $
5 
6 #
7 # A simple service client calling a running footstep_planner node.
8 # Using this program you can request footstep plans from the command line.
9 #
10 # Author: Armin Hornung, University of Freiburg
11 #
12 # This is program is part of the ROS footstep planner:
13 # http://www.ros.org/wiki/footstep_planner
14 # License: GPL 3
15 #
16 
17 import roslib
18 roslib.load_manifest('footstep_planner')
19 import rospy
20 
21 from humanoid_nav_msgs.srv import *
22 from geometry_msgs.msg import Pose2D
23 
24 import sys
25 
26 
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])
30 
31  rospy.init_node('plan_footsteps')
32  planSrv = rospy.ServiceProxy("plan_footsteps", PlanFootsteps)
33  start = Pose2D()
34  goal = Pose2D()
35 
36  start.x = float(sys.argv[1])
37  start.y = float(sys.argv[2])
38  start.theta = float(sys.argv[3])
39 
40  goal.x = float(sys.argv[4])
41  goal.y = float(sys.argv[5])
42  goal.theta = float(sys.argv[6])
43 
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)
46  resp = planSrv(start, goal)
47 
48  if resp.result == True:
49  rospy.loginfo("Planning succeeded with %d steps, path costs: %f" % (len(resp.footsteps), resp.costs))
50  else:
51  rospy.logerr("Service call failed")
52 
53  exit(0)


vigir_footstep_planner
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:29:59