Ask Your Question
0

Actionlib: preempt vs cancel

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

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
2

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

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

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 imagegvdhoorn ( 2019-09-19 02:07:10 -0500 )edit

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

ssssss gravatar imagessssss ( 2019-09-23 01:44:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 22 times

Last updated: Sep 18