0
$\begingroup$

Rosanswers logo

Hi

I'm using the SMACH state machine and want to trigger state changes from other nodes. For example from a keyboard node to ABORT the running process at any time.

One could of course do this by having the keyboard node send out an ABORT message on a topic and continuously monitor the given topic in each state, and induce a transition to an abort state if the ABORT message is received. But it sounds to me that it's to tedious to incorporate code in each state and at all waiting stages (for example while waiting for my laser to heat up or waiting for some other action to finish). Tedious and error prone.

Are there any other better ways to do this. Possibly some method to make this progress more event-driven.

regards - Frimann


Originally posted by Frimann on ROS Answers with karma: 46 on 2019-07-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Take a look at how FlexBE solves this. It's not entirely documented, but you can create a priority container which can interrupt another state machine containing several other states. Since FlexBE generates smach states, you could take a look at how it's doing that. Or you can just decide to use FlexBE without writing the smach states yourself, which I highly recommend.


Originally posted by achille with karma: 464 on 2020-06-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Frimann on 2020-06-17:
Thanks for the reply. I switched to FlexBe long time ago, and liking the experience.

$\endgroup$

Your Answer

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