10 #ifndef BEHAVIOUR_ACTUATORS_H
11 #define BEHAVIOUR_ACTUATORS_H
17 namespace behaviourcontrol
48 void updateActuators();
51 template <
class AClass>
void declareActuator(AClass* actuator);
54 std::vector<ActuatorBase*> AList;
94 virtual void update() {};
98 virtual const std::type_info*
getTypeInfo()
const = 0;
145 const T&
read()
const {
return data; }
153 virtual void update() { weightSum = 0.0; lastModifier = NULL; };
158 const Behaviour* lastModifier;
Implements a single behaviour.
Definition: behaviour.h:26
ActuatorBase(ActuatorManager *AMBase, const std::string &signalName=nullString)
Default constructor.
Definition: behaviour_actuators.cpp:70
virtual bool isCompatibleWith(const SensorBase *SBase) const =0
Abstract callback that should evaluate whether the current actuator is compatible the sensor SBase (c...
bool wasWrittenTo() const
Returns whether the actuator has been written to since the last update (update() is called at the beg...
Definition: behaviour_actuators.h:149
ActuatorManager * getBasePtr()
Return a pointer to the underlying ActuatorManager class object in the case of a derived actuator man...
Definition: behaviour_actuators.h:61
int ret_t
Used to represent an error code/function return value.
Definition: behaviour_common.h:142
virtual ret_t init()
Initialisation callback for the actuator manager. This function is called from BehaviourLayer::initAl...
Definition: behaviour_actuators.h:42
virtual ~Actuator()
Actuator object destructor.
Definition: behaviour_template_defns.h:190
ActuatorManager(BehaviourLayer *LBase)
Default constructor.
Definition: behaviour_actuators.cpp:20
Implements a single behaviour layer.
Definition: behaviour_layer.h:26
static const index_t DEF_ALIST_CAPACITY
Default capacity of the list that stores the child actuators of the actuator manager.
Definition: behaviour_actuators.h:30
Implements a single actuator of a given data type.
Definition: behaviour_actuators.h:131
Signals successful execution of a function, with no error conditions encountered. ...
Definition: behaviour_common.h:69
Implements a manager of a particular group of actuators.
Definition: behaviour_actuators.h:26
const bool AGGREGATABLE
Used in the Actuator constructor to explicitly specify an aggregatable actuator.
Definition: behaviour_common.h:151
const std::string signalName
The name of the actuator, used as the lookup key for the BehaviourManager::findActuator() function...
Definition: behaviour_actuators.h:90
virtual void readExternalData()
Interface layer specific callback that is intended to be overridden by the user to retrieve any avail...
Definition: behaviour_actuators.h:58
std::size_t index_t
Used to represent an array or vector index (must be an unsigned type)
Definition: behaviour_common.h:140
BehaviourLayer *const LBase
Pointer to the parent behaviour layer.
Definition: behaviour_actuators.h:38
static const std::string DEF_ACTUATOR_SIGNAL_NAME
Default actuator signal name used to generate a unique one, in the case that no name is provided by a...
Definition: behaviour_actuators.h:80
ActuatorBase * getBasePtr()
Return a pointer to the underlying ActuatorBase object in the case of a derived actuator class...
Definition: behaviour_actuators.h:103
void writeAgg(const T &newdata, const Behaviour *BBase)
General purpose write function to be used by behaviours to write to aggregatable actuators. Do not use this function on non-aggregatable actuators.
Definition: behaviour_template_defns.h:237
BehaviourLayer *const LBase
Pointer to the parent behaviour layer.
Definition: behaviour_actuators.h:88
ActuatorManager *const AMBase
Pointer to the parent actuator manager.
Definition: behaviour_actuators.h:89
virtual ~ActuatorManager()
Actuator manager object destructor.
Definition: behaviour_actuators.cpp:32
virtual const std::type_info * getTypeInfo() const =0
Update callback for the ActuatorBase object. Refer to the default override defined in Actuator::updat...
void writeHard(const T &newdata)
Special write function that can be used during initialisation to set up the value of an actuator...
Definition: behaviour_template_defns.h:274
std::string getUniqueName(const ActuatorManager *AMBase) const
Returns a unique actuator name.
Definition: behaviour_actuators.cpp:96
BehaviourManager *const MBase
Pointer to the parent behaviour manager.
Definition: behaviour_actuators.h:37
Implements a single actuator.
Definition: behaviour_actuators.h:76
Actuator(ActuatorManager *AMBase, const std::string &signalName=nullString, bool aggregatable=AGGREGATABLE)
Default constructor.
Definition: behaviour_template_defns.h:178
Implements a single behaviour manager.
Definition: behaviour_manager.h:27
virtual ~ActuatorBase()
ActuatorBase object destructor.
Definition: behaviour_actuators.cpp:81
const std::string nullString
Used to avoid the need for null string literals throughout the code.
Definition: behaviour_common.h:148
void write(const T &newdata, const Behaviour *BBase)
General purpose write function to be used by behaviours to write to non-aggregatable actuators...
Definition: behaviour_template_defns.h:207
virtual bool isCompatibleWith(const SensorBase *SBase) const
Abstract callback that should evaluate whether the current actuator is compatible the sensor SBase (c...
Definition: behaviour_template_defns.h:196
Implements a single sensor.
Definition: behaviour_sensors.h:76
virtual const std::type_info * getTypeInfo() const
Update callback for the ActuatorBase object. Refer to the default override defined in Actuator::updat...
Definition: behaviour_actuators.h:141
const T & read() const
Get function for the current data contained in the actuator.
Definition: behaviour_actuators.h:145
float level_t
Used to represent an activation level (raw activation levels should always be in the range [0...
Definition: behaviour_common.h:141
BehaviourManager *const MBase
Pointer to the parent behaviour manager.
Definition: behaviour_actuators.h:87
Common definitions include file for the internal Behaviour Control Framework source code...
const std::type_info *const typeInfo
The type information of the actuator data type.
Definition: behaviour_actuators.h:140
const bool aggregatable
Flag that specifies whether the actuator is aggregatable.
Definition: behaviour_actuators.h:139