Ask Your Question

can ActionServerWrapper use a dynamically set SMACH state

asked 2017-09-10 10:02:39 -0600

knxa gravatar image

I have just discovered ActionServerWrapper which seems to be the right choice because I need to execute and abort a smach statemachine though ROS messages.

But I have a long list of statemachines and only one can run at a time. It makes most sense to create just one ActionServerWrapper, which in the "Goal" message takes the name of the state to execute.

But the introduction tutorial shows an ActionServerWrapper where the SMACH state is set in the constructor. Can I change the main state later, just before execution?

BTW: The link at the bottom of this page, referring to the ActionServerWrapper documentation, is dead. Where do I find it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-15 07:02:43 -0600

knxa gravatar image

I made it work by subclassing ActionServerWrapper and overriding execute_cb. Then I can set the relevant state machine dynamically in the execute_cb before calling the original ActionServerWrapper.execute_cb.

Action server source:

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools



Asked: 2017-09-10 10:02:39 -0600

Seen: 170 times

Last updated: Nov 15 '17