0
$\begingroup$

Rosanswers logo

I have some questions about using SimpleActionState with Smach:

  • How does one define/set the action as succeeded, preempted, or aborted? Or is this set in the actionlib server using set_succeeded, etc.?
  • If this is set using the actionlib server can I still have a custom outcome? If yes, how?
  • Do I still need to define a new class or function to handle the states or do I just have to add the states (using StateMachine.add)?
  • Do I need to manually run actionlib servers or is this automatically run by smach?

Originally posted by Homer Manalo on ROS Answers with karma: 475 on 2011-03-11

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

How does one define/set the action as succeeded, preempted, or aborted? Or is this set in the actionlib server using set_succeeded, etc.?

I've not used SMACH with actions, but I have been using SMACH quite a bit with services. I believe the implementations are similar, in which case you'd get the outcomes from the action server. If you wanted custom outcomes, you'd probably have to write your own state.

Do I still need to define a new class or function to handle the states or do I just have to add the states (using StateMachine.add)?

If you use the SimpleActionState, then no, you do not need to define a new class. You do have to create an instance of the SimpleActionState class and in the process fill in a few details (namely the name of the service, what goal to supply, and what states to transition to on each outcome).

Do I need to manually run actionlib servers or is this automatically run by smach?

Yes, you'll need to start them manually (a launch file might be handy here).


Originally posted by fergs with karma: 13902 on 2011-03-12

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.