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

smach actionlib

asked 2012-02-09 03:11:37 -0500

joan gravatar image

updated 2014-01-28 17:11:19 -0500

ngrennan gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-03-01 10:24:01 -0500

Wim gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-02-09 03:11:37 -0500

Seen: 1,602 times

Last updated: Mar 01 '12