Implements a single behaviour.
More...
#include <behaviour.h>
Inherited by behaviourcontroltest::MyB1, behaviourcontroltest::MyB2, behaviourcontroltest::MyB3, and behaviourcontroltest::MyB4.
|
BehaviourManager *const | MBase |
| Pointer to the parent behaviour manager.
|
|
BehaviourLayer *const | LBase |
| Pointer to the parent behaviour layer.
|
|
const std::string | Mname |
| Human-friendly string name of the parent behaviour manager.
|
|
const std::string | Lname |
| Human-friendly string name of the parent behaviour layer.
|
|
const std::string | name |
| Human-friendly string name of the behaviour.
|
|
|
static const index_t | DEF_ILIST_CAPACITY = 16 |
| Default capacity of the inhibition lists that are used to store which behaviours are inhibitors and inhibitees of this behaviour.
|
|
static const std::string | DEF_BEHAVIOUR_NAME = "Behaviour" |
| Default behaviour name used to generate a unique one, in the case that no name is provided by a derived behaviour class.
|
|
|
virtual ret_t | init () |
| Initialisation callback for the behaviour. This function is called from BehaviourLayer::initAll() , and is intended to be overridden for the purpose of initialising the derived behaviour object.
|
|
virtual void | update () |
| Update callback for the behaviour object. This function is called from BehaviourLayer::updateAll() , which is used in BehaviourLayer::step() .
|
|
virtual void | execute () |
| Execute callback for the behaviour object. This function is called from BehaviourLayer::executeAll() , which is used in BehaviourLayer::step() .
|
|
virtual void | inhibited () |
| A callback for the behaviour object that is invoked instead of execute() when the behaviour is deactivated. This function is called from BehaviourLayer::executeAll() , which is used in BehaviourLayer::step() .
|
|
bool | wasJustActivated () const |
| Returns true when called from the execute() callback, and the behaviour was just activated. The return value is always true when called from inhibited() .
|
|
bool | wasJustDeactivated () const |
| Returns true when called from the inhibited() callback, and the behaviour was just inhibited. The return value is always true when called from execute() .
|
|
virtual level_t | computeActivationLevel () |
| Callback for the computation of the raw behaviour activation level. Valid return values are false , true , LVL_INACTIVE, LVL_ACTIVE and floating point numbers between 0 and 1 inclusive (values outside this range are coerced).
|
|
Implements a single behaviour.
This class is the base class of all behaviours that are used in an architecture.
Default constructor.
Note that although the default value for the name
parameter is nullString
, this will not actually become the behaviour's name if the parameter is omitted. This is just used to signal to the class's internals that it should generate a default name using the getUniqueName()
function. LBase
must never be null or a segmentation fault will result!
- Parameters
-
LBase | A pointer to the behaviour layer that the behaviour belongs to. |
name | The human-friendly name to give the behaviour (null means auto-generate). |
std::string Behaviour::getUniqueName |
( |
const BehaviourLayer * |
LBase | ) |
const |
Returns a unique behaviour name.
Automatically construct a unique name for the behaviour, for situations where none is provided by the derived class. The name that results of this function will be unique as long as the user does not explicitly use the same name somewhere else, either before or after the construction of this behaviour. If there are currently four behaviours in the LBase
layer, the generated name will be the concatenation of DEF_BEHAVIOUR_NAME and "4".
- Parameters
-
LBase | A non-null pointer to the parent behaviour layer. |
- Returns
- The required behaviour name.
The documentation for this class was generated from the following files:
- /home/hafez/Codes/Mine/humanoid_op_ros/src/nimbro/behaviour/behaviour_control/include/behaviour_control/classes/behaviour.h
- /home/hafez/Codes/Mine/humanoid_op_ros/src/nimbro/behaviour/behaviour_control/src/behaviour.cpp