Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
flexbe_core.core.operatable_state_machine.OperatableStateMachine Class Reference
Inheritance diagram for flexbe_core.core.operatable_state_machine.OperatableStateMachine:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args, kwargs)
 
def confirm (self, name, id)
 
def destroy (self)
 
def execute (self, parent_ud=smach.UserData())
 
def on_exit (self, userdata)
 
def replace (self, new_state)
 
- Public Member Functions inherited from flexbe_core.core.preemptable_state_machine.PreemptableStateMachine
def __init__ (self, args, kwargs)
 
- Public Member Functions inherited from flexbe_core.core.loopback_state_machine.LoopbackStateMachine
def __init__ (self, args, kwargs)
 
- Public Member Functions inherited from flexbe_core.core.lockable_state_machine.LockableStateMachine
def __init__ (self, args, kwargs)
 
def get_locked_state (self)
 
def is_locked (self)
 
def is_locked_inside (self)
 
def lock (self, path)
 
def transition_allowed (self, state, outcome)
 
def unlock (self, path)
 

Static Public Member Functions

def add (label, state, transitions=None, autonomy=None, remapping=None)
 

Public Attributes

 autonomy
 
 id
 
 name
 
- Public Attributes inherited from flexbe_core.core.lockable_state_machine.LockableStateMachine
 name
 
 transitions
 

Static Public Attributes

int autonomy_level = 3
 
bool silent_mode = False
 
- Static Public Attributes inherited from flexbe_core.core.lockable_state_machine.LockableStateMachine
 path_for_switch = None
 

Private Member Functions

def _async_execute (self, parent_ud=smach.UserData())
 
def _attach_callback (self, msg)
 
def _build_msg (self, prefix, msg=None)
 
def _disable_ros_control (self)
 
def _enable_ros_control (self)
 
def _mirror_structure_callback (self, msg)
 
def _notify_start (self)
 
def _notify_stop (self)
 
def _set_autonomy_level (self, msg)
 
def _sync_callback (self, msg)
 
def _transition_allowed (self, label, outcome)
 

Private Attributes

 _autonomy
 
 _current_state
 
 _inner_sync_request
 
 _is_controlled
 
 _is_running
 
 _message
 
 _ordered_states
 
 _preempted_label
 
 _preempted_state
 
 _pub
 
 _rate
 
 _sub
 

Detailed Description

A state machine that can be operated.
It synchronizes its current state with the mirror and supports some control mechanisms.

Definition at line 21 of file operatable_state_machine.py.

Constructor & Destructor Documentation

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.__init__ (   self,
  args,
  kwargs 
)

Definition at line 30 of file operatable_state_machine.py.

Member Function Documentation

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._async_execute (   self,
  parent_ud = smach.UserData() 
)
private
Run the state machine on entry to this state.
This will set the "closed" flag and spin up the execute thread. Once
this flag has been set, it will prevent more states from being added to
the state machine. 

Definition at line 81 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._attach_callback (   self,
  msg 
)
private

Definition at line 252 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._build_msg (   self,
  prefix,
  msg = None 
)
private
Adds this state machine to the initial structure message.

@type prefix: string
@param prefix: A path consisting of the container hierarchy containing this state.

@type msg: ContainerStructure
@param msg: The message that will finally contain the structure message.

Definition at line 278 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._disable_ros_control (   self)
private

Definition at line 353 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._enable_ros_control (   self)
private

Definition at line 337 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._mirror_structure_callback (   self,
  msg 
)
private

Definition at line 266 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._notify_start (   self)
private

Definition at line 330 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._notify_stop (   self)
private

Definition at line 345 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._set_autonomy_level (   self,
  msg 
)
private
Sets the current autonomy level. 

Definition at line 227 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._sync_callback (   self,
  msg 
)
private

Definition at line 240 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine._transition_allowed (   self,
  label,
  outcome 
)
private

Definition at line 274 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.add (   label,
  state,
  transitions = None,
  autonomy = None,
  remapping = None 
)
static
Add a state to the opened state machine.

@type label: string
@param label: The label of the state being added.

@param state: An instance of a class implementing the L{State} interface.

@param transitions: A dictionary mapping state outcomes to other state
labels or container outcomes.

@param autonomy: A dictionary mapping state outcomes to their required
autonomy level

@param remapping: A dictionary mapping local userdata keys to userdata
keys in the container.

Definition at line 139 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.confirm (   self,
  name,
  id 
)
Confirms the state machine and triggers the creation of the structural message.
It is mandatory to call this function at the top-level state machine
between building it and starting its execution.

@type name: string
@param name: The name of this state machine to identify it.

Definition at line 196 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.destroy (   self)

Definition at line 186 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.execute (   self,
  parent_ud = smach.UserData() 
)

Definition at line 47 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.on_exit (   self,
  userdata 
)

Definition at line 361 of file operatable_state_machine.py.

def flexbe_core.core.operatable_state_machine.OperatableStateMachine.replace (   self,
  new_state 
)

Definition at line 176 of file operatable_state_machine.py.

Member Data Documentation

flexbe_core.core.operatable_state_machine.OperatableStateMachine._autonomy
private

Definition at line 38 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._current_state
private

Definition at line 371 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._inner_sync_request
private

Definition at line 40 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._is_controlled
private

Definition at line 338 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._is_running
private

Definition at line 98 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._message
private

Definition at line 32 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._ordered_states
private

Definition at line 39 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._preempted_label
private

Definition at line 57 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._preempted_state
private

Definition at line 58 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._pub
private

Definition at line 42 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._rate
private

Definition at line 33 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine._sub
private

Definition at line 44 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine.autonomy

Definition at line 36 of file operatable_state_machine.py.

int flexbe_core.core.operatable_state_machine.OperatableStateMachine.autonomy_level = 3
static

Definition at line 27 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine.id

Definition at line 35 of file operatable_state_machine.py.

flexbe_core.core.operatable_state_machine.OperatableStateMachine.name

Definition at line 205 of file operatable_state_machine.py.

bool flexbe_core.core.operatable_state_machine.OperatableStateMachine.silent_mode = False
static

Definition at line 28 of file operatable_state_machine.py.


The documentation for this class was generated from the following file:


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