How to send a new goal (MoveBaseGoal) without interrupting the node (python)?
Hello to everyone.
When I want to send a goal(x,y) using the code below, everything works fine. The robot is moving towards the predefined goal. However my node stops working while MoveBase is under process.
So, if I desire to move to a new goal (before the previous goal come to an end), how can I send this new goal without interrupting the whole node ??
client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
client.wait_for_server()
goal = [x_goal, y_goal] # x,y are obtained by a function .. NOT always same x,y
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = "map"
goal.target_pose.header.stamp = rospy.Time.now()
goal.target_pose.pose = Pose(Point(x_goal, y_goal, 0.000), Quaternion(0, 0, 0, 1))
#Sends the goal to the action server.
client.send_goal(goal)
#Waits for the server to finish performing the action.
wait = client.wait_for_result()
#If the result doesn't arrive, assume the Server is not available
client.get_result()
Do I need to use a kind of feedback callback ? If so, would you please provide me a template of how I'm supposed to do it in Python ?
Thanks !!