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

Using Smach and SimpleActionState

asked 2011-03-11 17:04:37 -0600

Homer Manalo gravatar image

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?
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-03-12 13:52:30 -0600

fergs gravatar image

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).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-03-11 17:04:37 -0600

Seen: 719 times

Last updated: Mar 12 '11