Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do you cancel a navigation goal?

I'm trying to cancel a move_base goal sent by the explore node. SimpleActionClient.cancel_goal() doesnt seem to work at all, SimpleActionClient.cancel_all_goals() only works intermittently. I've included the code for my goal cancellation node below:

class cancelGoal(): def __init__(self): self.node_name = "cancel_goal"

    rospy.init_node(self.node_name)

self.explore_goal_sub = rospy.Subscriber("/move_base/goal", MoveBaseActionGoal, self.newGoalHandler)
self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
rospy.loginfo("Wating for move_base server.....")   
self.client.wait_for_server()

def newGoalHandler(self, new_goal):
self.client.cancel_goal()
    self.client.cancel_all_goals() # Try both
rospy.loginfo("Goal cancelled")
click to hide/show revision 2
highlighting

How do you cancel a navigation goal?

I'm trying to cancel a move_base goal sent by the explore node. SimpleActionClient.cancel_goal() doesnt seem to work at all, SimpleActionClient.cancel_all_goals() only works intermittently. I've included the code for my goal cancellation node below:

class cancelGoal():
    def __init__(self):
        self.node_name = "cancel_goal"

"cancel_goal"

        rospy.init_node(self.node_name)

 self.explore_goal_sub = rospy.Subscriber("/move_base/goal",  MoveBaseActionGoal, self.newGoalHandler)
 self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
 rospy.loginfo("Wating for move_base server.....")     self.client.wait_for_server()

 def newGoalHandler(self, new_goal):
 self.client.cancel_goal()
     self.client.cancel_all_goals() # Try both
 rospy.loginfo("Goal cancelled")

How do you cancel a navigation goal?

I'm trying to cancel a move_base goal sent by the explore node. SimpleActionClient.cancel_goal() doesnt seem to work at all, SimpleActionClient.cancel_all_goals() only works intermittently. I've included the code for my goal cancellation node below:

class cancelGoal():
    def __init__(self):
        self.node_name = "cancel_goal"

        rospy.init_node(self.node_name)

        self.explore_goal_sub = rospy.Subscriber("/move_base/goal", 
                                    MoveBaseActionGoal, self.newGoalHandler)
        self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
        rospy.loginfo("Wating for move_base server.....")       
        self.client.wait_for_server()

    def newGoalHandler(self, new_goal):
        self.client.cancel_goal()
        self.client.cancel_all_goals() # Try both
        rospy.loginfo("Goal cancelled")

How do you cancel a navigation goal?

I'm trying to cancel a move_base goal sent by the explore node. SimpleActionClient.cancel_goal() doesnt seem to work at all, SimpleActionClient.cancel_all_goals() only works intermittently. I've included the code for my goal cancellation node below:

class cancelGoal():
    def __init__(self):
        self.node_name = "cancel_goal"

        rospy.init_node(self.node_name)

        self.explore_goal_sub = rospy.Subscriber("/move_base/goal", 
                                    MoveBaseActionGoal, self.newGoalHandler)
        self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
        rospy.loginfo("Wating for move_base server.....")       
        self.client.wait_for_server()

    def newGoalHandler(self, new_goal):
        self.client.cancel_goal()
        self.client.cancel_all_goals() # Try both
        rospy.loginfo("Goal cancelled")

How do you cancel a navigation goal?

I'm trying to cancel a move_base goal sent by the explore node. SimpleActionClient.cancel_goal() doesnt seem to work at all, SimpleActionClient.cancel_all_goals() only works intermittently. I've included the code for my goal cancellation node below:

class cancelGoal():
    def __init__(self):
        self.node_name = "cancel_goal"

        rospy.init_node(self.node_name)

        self.explore_goal_sub = rospy.Subscriber("/move_base/goal", 
                                    MoveBaseActionGoal, self.newGoalHandler)
        self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
        rospy.loginfo("Wating for move_base server.....")       
        self.client.wait_for_server()

    def newGoalHandler(self, new_goal):
        self.client.cancel_goal()
        self.client.cancel_all_goals() # Try both
        rospy.loginfo("Goal cancelled")