loopback_state_machine.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
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         # add loopback outcome
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)


flexbe_core
Author(s): Philipp Schillinger
autogenerated on Thu Jun 6 2019 19:32:27