![]() |
NimbRo ROS Soccer Package
|
Implements a single sensor of a given data type. More...
#include <behaviour_sensors.h>
Public Member Functions | |
Sensor (SensorManager *SMBase, const std::string &signalName) | |
Default constructor. More... | |
virtual | ~Sensor () |
Destructor. | |
virtual const std::type_info * | getTypeInfo () const |
Abstract callback that should be overridden to return the type information of the sensor (i.e. a std::type_info object). Refer to the default override Sensor::getTypeInfo() . | |
virtual bool | isCompatibleWith (const ActuatorBase *ABase) const |
Abstract callback that should evaluate whether the current sensor is compatible the actuator ABase (can bind to it). Refer to the default override Sensor::isCompatibleWith() . | |
virtual bool | isBound () const |
Return whether this sensor has successfully been bound to an actuator. | |
bool | wasWrittenTo () const |
Valid after every call to getLatestData() (called by SensorManager::updateSensors() during the update phase of a global step). | |
const T & | read () const |
Get the data from the last sensor update (i.e. get the data that was most recently copied from the source actuator). | |
![]() | |
SensorBase (SensorManager *SMBase, const std::string &signalName) | |
Default constructor. More... | |
virtual | ~SensorBase () |
SensorBase object destructor. | |
SensorBase * | getBasePtr () |
Return a pointer to the underlying SensorBase object in the case of a derived sensor class. | |
Public Attributes | |
const std::type_info *const | typeInfo |
![]() | |
BehaviourManager *const | MBase |
Pointer to the parent behaviour manager. | |
BehaviourLayer *const | LBase |
Pointer to the parent behaviour layer. | |
SensorManager *const | SMBase |
Pointer to the parent sensor manager. | |
const std::string | signalName |
The name of the actuator that this sensor should bind to. This name is used as the lookup key for the BehaviourManager::findActuator() function. | |
Protected Member Functions | |
virtual ret_t | bindTo (const ActuatorBase *ABase) |
Bind to the actuator ABase . This must be called with an ABase that is actually pointing to an Actuator<T> , or no binding happens. | |
virtual void | getLatestData () |
Get the latest data from the source actuator. | |
Implements a single sensor of a given data type.
This class is used to define the sensors of a SensorManager. The template parameter specifies the desired data type of the sensor.
behaviourcontrol::Sensor< T >::Sensor | ( | SensorManager * | SMBase, |
const std::string & | signalName | ||
) |
Default constructor.
SMBase | A pointer to the sensor manager that the sensor belongs to. |
signalName | The unique human-friendly name of the actuator to bind the sensor to. Lookup of the actuator occurs using this name as the key. The name can be completely arbitrary, with the only restriction being that it can't be the null string, but recommended sample names include "OtherLayer/ActuatorName" and "Layer1/TargetX" , where OtherLayer and Layer1 are the names of the layers in which the ActuatorName and TargetX actuators are defined respectively. |