The base abstract class for the Sensor hierarchy. More...

Inheritance diagram for Sensor:

Public Member Functions

 Sensor (ConfigurationParameters &params, QString prefix)
 Constructor and Configure.
 
 ~Sensor ()
 Destructor.
 
QString name ()
 Return the name of the Sensor.
 
void save (ConfigurationParameters &params, QString prefix)
 Save the parameters into the ConfigurationParameters.
 
void setName (QString name)
 Use this method for changing the name of the Sensor.
 
virtual int size ()=0
 Return the number of neurons on which the Sensor will set the input.
 
virtual void update ()=0
 Update the state of the Sensor every time step; the actual behaviour is implemented in subclasses.
 
- Public Member Functions inherited from ParameterSettableInConstructor
 ParameterSettableInConstructor (ConfigurationParameters &, QString)
 
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
 ParameterSettable ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ConcurrentResourcesUser
void addUsableResource (QString resource)
 
void addUsableResources (QStringList resources)
 
void declareResource (QString name, T *resource, QString lockBuddy="")
 
void deleteResource (QString name)
 
T * getResource (QString name, bool *resourceExists=NULL)
 
bool hasResource (QString name) const
 
void removeAllUsableResources ()
 
void removeUsableResource (QString resource)
 
void removeUsableResources (QStringList resources)
 
virtual void shareResourcesWith (ResourcesUser *buddy)
 
void usableResources (QStringList resources)
 
bool usedResourcesExist (QStringList *nonExistingResources=NULL) const
 

Static Public Member Functions

static void describe (QString type)
 Describe all the parameter for configuring the Sensor.
 
- Static Public Member Functions inherited from ParameterSettableInConstructor
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 
- Static Public Member Functions inherited from ParameterSettable
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 

Protected Member Functions

QString actualResourceNameForMultirobot (QString resourceName) const
 Returns the actual resource name to use.
 
void checkAllNeededResourcesExist ()
 Checks whether all resources we need are existing and throws an exception if they aren't.
 
void resetNeededResourcesCheck ()
 Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will perform the full check and not the quick one.
 
- Protected Member Functions inherited from ParameterSettableInConstructor
void notifyChangesToParam (QString paramName)
 
- Protected Member Functions inherited from ParameterSettable
void notifyChangesToParam (QString paramName)
 
- Protected Member Functions inherited from ConcurrentResourcesUser
T * getResource ()
 
ResourcesUseroperator= (const ResourcesUser &other)
 
virtual void resourceChanged (QString name, ResourceChangeType changeType)
 
 ResourcesUser ()
 
 ResourcesUser (const ResourcesUser &other)
 
- Protected Member Functions inherited from ResourcesUser
 ResourcesUser (const ResourcesUser &other)
 
virtual void notifyResourceChange (ResourceHandler *resource, ResourceChangeType changeType)=0
 
ResourcesUseroperator= (const ResourcesUser &other)
 

Additional Inherited Members

- Public Types inherited from ParameterSettableInConstructor
enum  Property
 
- Public Types inherited from ConcurrentResourcesUser
typedef
Resource::ResourceChangeType 
ResourceChangeType
 
- Public Attributes inherited from ParameterSettableInConstructor
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettableInConstructor
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Static Protected Member Functions inherited from ParameterSettableInConstructor
static Descriptor addTypeDescription (QString type, QString shortHelp, QString longHelp=QString(""))
 
static void setGraphicalEditor (QString type)
 
- Protected Attributes inherited from ConcurrentResourcesUser
ResourceCollectionHolder m_resources
 

Detailed Description

The base abstract class for the Sensor hierarchy.

A Sensor is an object that read data from a resource and put that data into the neural network converting it into the appropriate way In child class implement also the resourceChanged() function to get notified of resources creation/modification

Definition at line 97 of file neuroninterfaces.h.

Constructor & Destructor Documentation

Sensor ( ConfigurationParameters params,
QString  prefix 
)

Constructor and Configure.

Parameters
paramsis the ConfigurationParameters containing the parameters
prefixis the path prefix to the paramters for this Sensor

Definition at line 30 of file neuroninterfaces.cpp.

References ConfigurationHelper::getString(), and Sensor::setName().

~Sensor ( )

Destructor.

Definition at line 38 of file neuroninterfaces.cpp.

Member Function Documentation

QString actualResourceNameForMultirobot ( QString  resourceName) const
protected

Returns the actual resource name to use.

This function mangles the name of the resource so that the correct name is used in case of multirobot setups. NOTE: use this only for resources that are robot-specific because the name is always mangled (no check is done to see if resourceName is already the name of an existing resource)

Definition at line 85 of file neuroninterfaces.cpp.

Referenced by EpuckSensor::EpuckSensor(), iCubSensor::iCubSensor(), KheperaSensor::KheperaSensor(), and MarXbotSensor::MarXbotSensor().

QString name ( )

Return the name of the Sensor.

Typically, it is the name of the subclass

Definition at line 57 of file neuroninterfaces.cpp.

Referenced by iCubPalmTargetDistSensor::iCubPalmTargetDistSensor(), ObjectPositionSensor::ObjectPositionSensor(), FakeSensor::resourceChanged(), iCubArmJointsSensor::resourceChanged(), ObjectPositionSensor::resourceChanged(), iCubPalmTargetDistSensor::resourceChanged(), iCubPalmTouchSensor::resourceChanged(), iCubTorsoJointsSensor::resourceChanged(), iCubHeadJointsSensor::resourceChanged(), iCubPCHeadJointsSensor::resourceChanged(), iCubHandJointsSensor::resourceChanged(), Sensor::setName(), FakeSensor::update(), iCubArmJointsSensor::update(), EpuckProximityIRSensor::update(), KheperaProximityIRSensor::update(), ObjectPositionSensor::update(), ColorCameraSensor::update(), MarXbotProximityIRSensor::update(), LinearCameraSensor::update(), EpuckGroundIRSensor::update(), KheperaSampledProximityIRSensor::update(), MarXbotGroundBottomIRSensor::update(), iCubPalmTargetDistSensor::update(), iCubPalmTouchSensor::update(), EpuckLinearCameraSensor::update(), MarXbotGroundAroundIRSensor::update(), iCubHandTouchSensor::update(), MarXbotLinearCameraSensor::update(), EpuckSampledProximityIRSensor::update(), iCubTorsoJointsSensor::update(), iCubHeadJointsSensor::update(), iCubPCHeadJointsSensor::update(), MarXbotTractionSensor::update(), iCubHandJointsSensor::update(), MarXbotSampledProximityIRSensor::update(), iCubFingertipsTouchSensor::update(), MarXbotAttachmentDeviceSensor::update(), iCubPalmPatchesTouchSensor::update(), and HandObjectVisualOffsetSensor::update().

void resetNeededResourcesCheck ( )
protected

Resets the check on needed resources so that the next call to checkAllNeededResourcesExist() will perform the full check and not the quick one.

Call this if you get notified that a resource has been deleted so that we can check if it is available again when you need it

Definition at line 80 of file neuroninterfaces.cpp.

Referenced by EpuckSensor::resourceChanged(), iCubSensor::resourceChanged(), MarXbotSensor::resourceChanged(), KheperaSensor::resourceChanged(), FakeSensor::resourceChanged(), and ObjectPositionSensor::resourceChanged().

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Save the parameters into the ConfigurationParameters.

Parameters
paramsis the ConfigurationParameters where save the parameters
prefixis the path prefix for the parameters to save

Implements ParameterSettableInConstructor.

Reimplemented in ObjectPositionSensor, and FakeSensor.

Definition at line 41 of file neuroninterfaces.cpp.

References ConfigurationParameters::createParameter(), and ConfigurationParameters::startObjectParameters().

Referenced by FakeSensor::save(), EpuckSensor::save(), iCubSensor::save(), MarXbotSensor::save(), KheperaSensor::save(), and ObjectPositionSensor::save().

void setName ( QString  name)

Use this method for changing the name of the Sensor.

Definition at line 61 of file neuroninterfaces.cpp.

References Sensor::name().

Referenced by Sensor::Sensor().


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