ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Actionlib: preempt vs cancel

asked 2019-09-18 09:04:20 -0600

ssssss gravatar image

Hi,

I'm currently trying to understand the Actionlib state machine and am not clear about what "preempt" exactly means in this context.

The wikipage (http://wiki.ros.org/actionlib/DetailedDescription) describes the "Preemted" state as:

Preempted - Processing of the goal was canceled by either another goal, or a cancel request sent to the action server

For the SimpleActionServer it says here (http://wiki.ros.org/actionlib#Using_the_ActionClient), that:

New goals preempt previous goals based on the stamp in their GoalID field (later goals preempt earlier ones)

However, here (http://wiki.ros.org/actionlib/DetailedDescription) it also says about the SimpleActionClient:

For simplicity, the Simple Action Client tracks only one goal at a time. When a user sends a goal with the simple client, it disables all callbacks associated with the previous goal and also stops tracking its state. Note that it does not cancel the previous goal!

The later seems to make a distinction between cancelling and preempting and I am unclear if there is actually a difference or what the SimpleActionServer actually does when a new goal arrives.

For example:

If I have a goal which changes over time, is it enough to simply send the updated goal via the SimpleActionClient to the server or should I actively cancel the previous goal in advance? I don't need any of the previous goals and don't want to have any overhead on the server regarding them. I am simply interested in the most recent goal.

I'd appreciate any kind of information on this topic, thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2019-09-18 14:07:42 -0600

Hi, to make it really clear:

  • Cancel : Stop processing goal(s)
  • Preempt : Stop processing current goal(s) in favor of new goal(s) given.

Does that make sense?

edit flag offensive delete link more

Comments

2

Cancel : Stop processing goal(s)

I'd add: "stop processing currently active goal(s)*.

The way it's currently phrased makes it sound like the action server will never again accept a new goal, which is not the case.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-19 02:07:10 -0600 )edit

That does make sense now. Thanks for clearing that up!

ssssss gravatar image ssssss  ( 2019-09-23 01:44:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-09-18 09:04:20 -0600

Seen: 4,320 times

Last updated: Sep 18 '19