How can I use GetPlan service in Python ?
Hello!
I want to use make_plan service of move_base package in order to create a path towards a specified goal. How am i supposed to deal with this service in Python ?
start = PoseStamped()
start.header.seq = 0
start.header.frame_id = "map"
start.header.stamp = rospy.Time(0)
start.pose.position.x = robot_x #2.6
start.pose.position.y = robot_y #1.3
Goal = PoseStamped()
Goal.header.seq = 0
Goal.header.frame_id = "map"
Goal.header.stamp = rospy.Time(0)
Goal.pose.position.x = goal_x #-6.2
Goal.pose.position.y = goal_y #-3.0
srv = GetPlan()
srv.request.start = start
srv.request.goal = Goal
srv.request.tolerance = 1.5
I assume that in this way I can declare the robot's current position(start) and target's coordinates(goal) as presented here. In which way should I initialize the server so that i can obtain the path ? What's the crucial part that I have to add in my code?