priority_container.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import traceback
3 import smach
4 
5 from smach.state_machine import StateMachine
6 
7 from flexbe_core.core.operatable_state_machine import OperatableStateMachine
8 
9 
11  """
12  A state machine that is always executed alone when becoming active.
13  """
14  active_container = None
15 
16  def __init__(self, conditions=dict(), *args, **kwargs):
17  super(PriorityContainer, self).__init__(*args, **kwargs)
18 
20 
21  def execute(self, *args, **kwargs):
22  if PriorityContainer.active_container != self._get_path():
23  self._parent_active_container = PriorityContainer.active_container
24  PriorityContainer.active_container = self._get_path()
25 
26  outcome = OperatableStateMachine.execute(self, *args, **kwargs)
27 
28  if outcome != self._loopback_name:
29  PriorityContainer.active_container = self._parent_active_container
30 
31  return outcome
def __init__(self, conditions=dict(), args, kwargs)


flexbe_core
Author(s): Philipp Schillinger
autogenerated on Wed Jun 5 2019 21:51:59