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)
28 if state.sleep_duration > 0:
29 sleep_dur = state.sleep_duration
if sleep_dur
is None else min(sleep_dur, state.sleep_duration)
30 return sleep_dur
or 0.
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:
75 self.
_parent._inner_sync_request =
True
83 input_keys=state.input_keys, output_keys=state.output_keys)
as userdata:
85 state._entering =
True
86 state.on_exit(userdata)
88 result = state.execute(userdata)
89 except Exception
as e:
97 if isinstance(state, EventState):
98 state._enable_ros_control()
99 if isinstance(state, OperatableStateMachine):
100 state._enable_ros_control()
104 if isinstance(state, EventState):
105 state._disable_ros_control()
106 if isinstance(state, OperatableStateMachine):
107 state._disable_ros_control()
110 for state
in self.
_states if states
is None else states: