Robotics StackExchange | Archived questions

Callbacks are not terminated after state transition in SMACH

After a lot of research, I did not find any proper way to stop callbacks from being called from a state that has already been transitioned.

For example imagine two states:

The "scan" callback in the GOFORWARD state takes the values of the front LIDAR. However, even when the state machine transitions from GOFORWARD to STOP, the scan callback is still active.

The only walk-around solution I found so far to this is to have a boolean flag in an if statement at the beginning of the callback, that turns False when the condition of the 2m is met.

Is there a way to properly terminate a state (and all its callbacks), when the state machine shifts to another state?

Asked by AlexandrosNic on 2022-01-31 10:36:40 UTC

Comments

Answers