Go to the documentation of this file.00001
00002 import rospy
00003
00004 from flexbe_core.core.lockable_state_machine import LockableStateMachine
00005
00006
00007 class LoopbackStateMachine(LockableStateMachine):
00008 """
00009 A state machine that can loop back to itself.
00010 """
00011
00012 _loopback_name = 'loopback'
00013
00014 def __init__(self, *args, **kwargs):
00015
00016 if len(args) > 0:
00017 args[0].append(self._loopback_name)
00018 else:
00019 outcomes = kwargs.get('outcomes', [])
00020 outcomes.append(self._loopback_name)
00021 kwargs['outcomes'] = outcomes
00022
00023 super(LoopbackStateMachine, self).__init__(*args, **kwargs)