12 A state machine that can be operated. 13 It synchronizes its current state with the mirror and supports some control mechanisms. 16 def __init__(self, conditions=dict(), *args, **kwargs):
17 super(ConcurrencyContainer, self).
__init__(*args, **kwargs)
35 if state.name
in list(self._returned_outcomes.keys())
and self.
_returned_outcomes[state.name]
is not None:
37 if (PriorityContainer.active_container
is not None 38 and not all(a == s
for a, s
in zip(PriorityContainer.active_container.split(
'/'),
39 state.path.split(
'/')))):
40 if isinstance(state, EventState):
41 state._notify_skipped()
42 elif state.get_deep_state()
is not None:
43 state.get_deep_state()._notify_skipped()
45 if state.sleep_duration <= 0:
48 if state.sleep_duration <= 0:
52 sleep_dur = state.sleep_duration
if sleep_dur
is None else min(sleep_dur, state.sleep_duration)
73 states=[s
for s
in self.
_states if (s.name
not in list(self._returned_outcomes.keys())
or 78 self._parent._inner_sync_request =
True 86 input_keys=state.input_keys, output_keys=state.output_keys)
as userdata:
88 state._entering =
True 89 state.on_exit(userdata)
91 result = state.execute(userdata)
92 except Exception
as e:
100 if isinstance(state, EventState):
101 state._enable_ros_control()
102 if isinstance(state, OperatableStateMachine):
103 state._enable_ros_control()
107 if isinstance(state, EventState):
108 state._disable_ros_control()
109 if isinstance(state, OperatableStateMachine):
110 state._disable_ros_control()
113 for state
in self.
_states if states
is None else states:
def wait(self, seconds=None, condition=None)
def _disable_ros_control(self)
def _execute_current_state(self)
def current_state_label(self)
def __init__(self, conditions=dict(), args, kwargs)
def _execute_single_state(self, state, force_exit=False)
def on_exit(self, userdata, states=None)
def _enable_ros_control(self)