Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
flexbe_core.behavior.Behavior Class Reference
Inheritance diagram for flexbe_core.behavior.Behavior:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def add_behavior (self, behavior_class, behavior_id)
 
def add_parameter (self, name, default)
 
def confirm (self)
 
def create (self)
 
def execute (self)
 
def get_current_state (self)
 
def get_locked_state (self)
 
def preempt (self)
 
def preempt_for_switch (self)
 
def prepare_for_execution (self, input_data={})
 
def prepare_for_switch (self, state)
 
def set_up (self, id, autonomy_level, debug)
 
def use_behavior (self, behavior_class, behavior_id, default_keys=None, parameters=None)
 

Public Attributes

 contains
 
 id
 
 name
 
 requested_state_path
 

Private Member Functions

def _get_muted_state_machine (self)
 
def _get_state_machine (self)
 
def _get_states_of_path (self, path, container)
 
def _mute_state_machine (self, sm)
 

Private Attributes

 _autonomy_level
 
 _behaviors
 
 _debug
 
 _state_machine
 

Detailed Description

This is the superclass for all implemented behaviors.

Definition at line 18 of file behavior.py.

Constructor & Destructor Documentation

def flexbe_core.behavior.Behavior.__init__ (   self)
Please call this superclass constructor first when overriding it with your behavior.

Definition at line 23 of file behavior.py.

Member Function Documentation

def flexbe_core.behavior.Behavior._get_muted_state_machine (   self)
private

Definition at line 205 of file behavior.py.

def flexbe_core.behavior.Behavior._get_state_machine (   self)
private

Definition at line 200 of file behavior.py.

def flexbe_core.behavior.Behavior._get_states_of_path (   self,
  path,
  container 
)
private

Definition at line 224 of file behavior.py.

def flexbe_core.behavior.Behavior._mute_state_machine (   self,
  sm 
)
private

Definition at line 211 of file behavior.py.

def flexbe_core.behavior.Behavior.add_behavior (   self,
  behavior_class,
  behavior_id 
)
Adds another behavior as part of this behavior.
This other behavior should be declared as contained in the behavior manifest.

@type behavior_class: class
@param behavior_class: The class implementing the other behavior.

@type behavior_id: string
@param behavior_id: Unique identifier for this behavior instance.

Definition at line 67 of file behavior.py.

def flexbe_core.behavior.Behavior.add_parameter (   self,
  name,
  default 
)
Adds a parameter to this behavior.
The parameter should be declared in the behavior manifest.

@type name: string
@param name: The name of the parameter.

@type default: object
@param default: The default value of this parameter. Be sure to set it to the right type.

Definition at line 54 of file behavior.py.

def flexbe_core.behavior.Behavior.confirm (   self)
Confirms that this behavior is ready for execution.

Definition at line 134 of file behavior.py.

def flexbe_core.behavior.Behavior.create (   self)
Should create the state machine for this behavior and return it.
It is called immediately before executing the behavior, so used parameters will have their final value when called.

@return The complete state machine for this behavior.

Definition at line 42 of file behavior.py.

def flexbe_core.behavior.Behavior.execute (   self)
Called when the behavior is executed.
Need to call self.execute_behavior when ready to start the state machine and return its result.

@return: A string containing the execution result such as finished or failed.

Definition at line 143 of file behavior.py.

def flexbe_core.behavior.Behavior.get_current_state (   self)

Definition at line 178 of file behavior.py.

def flexbe_core.behavior.Behavior.get_locked_state (   self)

Definition at line 181 of file behavior.py.

def flexbe_core.behavior.Behavior.preempt (   self)

Definition at line 190 of file behavior.py.

def flexbe_core.behavior.Behavior.preempt_for_switch (   self)

Definition at line 193 of file behavior.py.

def flexbe_core.behavior.Behavior.prepare_for_execution (   self,
  input_data = {} 
)
Prepares this behavior for execution by building its state machine.

Definition at line 119 of file behavior.py.

def flexbe_core.behavior.Behavior.prepare_for_switch (   self,
  state 
)
Prepares the behavior for being executed after a behavior switch.

@type name: string
@param name: The name of this behavior.

Definition at line 158 of file behavior.py.

def flexbe_core.behavior.Behavior.set_up (   self,
  id,
  autonomy_level,
  debug 
)

Definition at line 219 of file behavior.py.

def flexbe_core.behavior.Behavior.use_behavior (   self,
  behavior_class,
  behavior_id,
  default_keys = None,
  parameters = None 
)
Creates a state machine implementing the given behavior to use it in the behavior state machine.
Behavior has to be added first.

@type behavior_class: class
@param behavior_class: The class implementing the other behavior.

@type behavior_id: string
@param behavior_id: Same identifier as used for adding.

@type default_keys: list
@param default_keys: List of input keys of the behavior which should be ignored and instead use the default values as given by the behavior.

@type parameters: dict
@param parameters: Optional assignment of values to behavior parameters. Any assigned parameter will be ignored for runtime customization, i.e., cannot be overwritten by a user who runs the behavior.

Definition at line 84 of file behavior.py.

Member Data Documentation

flexbe_core.behavior.Behavior._autonomy_level
private

Definition at line 34 of file behavior.py.

flexbe_core.behavior.Behavior._behaviors
private

Definition at line 32 of file behavior.py.

flexbe_core.behavior.Behavior._debug
private

Definition at line 35 of file behavior.py.

flexbe_core.behavior.Behavior._state_machine
private

Definition at line 27 of file behavior.py.

flexbe_core.behavior.Behavior.contains

Definition at line 31 of file behavior.py.

flexbe_core.behavior.Behavior.id

Definition at line 29 of file behavior.py.

flexbe_core.behavior.Behavior.name

Definition at line 28 of file behavior.py.

flexbe_core.behavior.Behavior.requested_state_path

Definition at line 37 of file behavior.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