uleroboticsgroup / yasmin

YASMIN (Yet Another State MachINe)
GNU General Public License v3.0
130 stars 25 forks source link

Pause and resume an action state #18

Closed WZHwerk5 closed 3 months ago

WZHwerk5 commented 3 months ago

Hi, I just wonder how to pause/resume an action state with a ROS2 service. Thanks!

mgonzs13 commented 3 months ago

Hey @WZHwerk5, the action state involves using ROS 2 actions which, as far as I know, cannot be paused/resumed. However, pausing/resuming a state could be a good feature. Do you have any suggestions?

WZHwerk5 commented 3 months ago

Ok I see, thanks for quick reply! Let's step back a bit, how to cancel a running action state by a service (e.g. a Trigger)? Could you give me an example? Thanks in advance

mgonzs13 commented 3 months ago

In YASMIN, all states can be implemented to be canceled. In the case of the action states, canceling a state means canceling the action server. An example of action state is shown here. Thus, to cancel the FSM sm, you can use the following code:

sm.cancel_state()
mgonzs13 commented 3 months ago

Hey @WZHwerk5, how is this going?

WZHwerk5 commented 3 months ago

Hi, it worked, thanks.