0
$\begingroup$

Rosanswers logo

I am currently working with SMACH and using SimpleActionState as action clients for the roscpp Action servers I have developed.

One of the main key points for using actions, as stated in the ROS actionlib wiki page, was:

The actionlib package provides a standardized interface for interfacing with preemptible tasks

I was wondering how this feature could be achieved when using the SimpleActionState object. I would like to subscribe to the action feedback topic to keep track of the action server behavior. Then, at some point, the client would then be able to preempt the requested action depending on the data received.

By looking at the SimpleActionState Tutorials I have seen how can goal and result callbacks be defined, but nothing related to feedback. In addition, on the SimpleActionState API I can only find a preempt_timeout parameter, but nothing related to preemption callbacks. In a previous question, issues with this specific parameter were already observed.

A possible work around, would be to use a concurrence container which would launch both a SimpleActionState and a subscriber state to the feedback topic. With this solution though, I would not be able to preempt the action.

If there is no way to preempt an action, then which is the difference between actions and services when using SMACH?


Originally posted by joan on ROS Answers with karma: 245 on 2012-02-09

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So if I understand your question correctly, you start out with an actionlib action, and you then wrap this action in a smach state using the SimpleActionState. And now you want to preempt this action. So what you need is the generic smach preemption mechanism described in this tutorial. Smach will then automatically pass on the preemption request to your actionlib action.

For this mechanism to work you should make sure that your actionlib action implements preemption.


Originally posted by Wim with karma: 2915 on 2012-03-01

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.