NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
behaviourcontrol::SensorBase Class Referenceabstract

Implements a single sensor. More...

#include <behaviour_sensors.h>

Inheritance diagram for behaviourcontrol::SensorBase:
behaviourcontrol::Sensor< T > behaviourcontrol::Sensor< bool > behaviourcontrol::Sensor< double > behaviourcontrol::Sensor< float > behaviourcontrol::Sensor< int > behaviourcontrol::Sensor< long > behaviourcontrol::Sensor< unsigned long >

Public Member Functions

 SensorBase (SensorManager *SMBase, const std::string &signalName)
 Default constructor. More...
 
virtual ~SensorBase ()
 SensorBase object destructor.
 
virtual const std::type_info * getTypeInfo () const =0
 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 =0
 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 =0
 Abstract function that should be made to return whether this sensor has been bound to an actuator.
 
SensorBasegetBasePtr ()
 Return a pointer to the underlying SensorBase object in the case of a derived sensor class.
 

Public Attributes

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)=0
 Abstract function that should be made to bind the sensor to the ABase actuator.
 
virtual void getLatestData ()=0
 Abstract function that should be made to retrieve the data from the bound actuator, and store it locally in the sensor.
 

Friends

class SensorManager
 

Detailed Description

Implements a single sensor.

This class is the base class of all sensors that are used in a SensorManager.

Constructor & Destructor Documentation

SensorBase::SensorBase ( SensorManager SMBase,
const std::string &  signalName 
)

Default constructor.

Parameters
SMBaseA pointer to the sensor manager that the sensor belongs to.
signalNameThe 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.
See Also
Default Actuator constructor

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