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

Public Member Functions | |
Sensor (ConfigurationParameters ¶ms, QString prefix) | |
Constructor and Configure. | |
~Sensor () | |
Destructor. | |
QString | name () |
Return the name of the Sensor. | |
void | save (ConfigurationParameters ¶ms, 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. | |
Static Public Member Functions | |
static void | describe (QString type) |
Describe all the parameter for configuring the Sensor. | |
Protected Member Functions | |
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. |
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:
-
params is the ConfigurationParameters containing the parameters prefix is 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 37 of file neuroninterfaces.cpp.
Member Function Documentation
void checkAllNeededResourcesExist | ( | ) | [protected] |
Checks whether all resources we need are existing and throws an exception if they aren't.
The result of the check is stored, so subsequent calls to this functions are quick (unless you call resetNeededResourcesCheck(), see that function description)
Definition at line 62 of file neuroninterfaces.cpp.
References ConfigurationHelper::throwUserMissingResourceError(), and ConcurrentResourcesUser::usedResourcesExist().
Referenced by ObjectPositionSensor::update(), MarXbotGroundAroundIRSensor::update(), MarXbotGroundBottomIRSensor::update(), MarXbotProximityIRSensor::update(), HandObjectVisualOffsetSensor::update(), iCubPalmPatchesTouchSensor::update(), iCubFingertipsTouchSensor::update(), iCubHandJointsSensor::update(), iCubHeadJointsSensor::update(), iCubTorsoJointsSensor::update(), iCubHandTouchSensor::update(), iCubPalmTouchSensor::update(), iCubPalmTargetDistSensor::update(), ColorCameraSensor::update(), and iCubArmJointsSensor::update().
void describe | ( | QString | type | ) | [static] |
Describe all the parameter for configuring the Sensor.
Reimplemented from ParameterSettable.
Reimplemented in iCubSensor, iCubArmJointsSensor, ColorCameraSensor, iCubPalmTargetDistSensor, iCubPalmTouchSensor, iCubHandTouchSensor, iCubTorsoJointsSensor, iCubHeadJointsSensor, iCubHandJointsSensor, iCubFingertipsTouchSensor, iCubPalmPatchesTouchSensor, HandObjectVisualOffsetSensor, MarXbotSensor, MarXbotProximityIRSensor, MarXbotGroundBottomIRSensor, MarXbotGroundAroundIRSensor, and ObjectPositionSensor.
Definition at line 49 of file neuroninterfaces.cpp.
References ParameterSettable::addTypeDescription(), ParameterSettable::Descriptor::describeString(), and ParameterSettable::StringDescriptor::help().
QString name | ( | ) |
Return the name of the Sensor.
Typically, it is the name of the subclass
Definition at line 54 of file neuroninterfaces.cpp.
Referenced by EvoRobotExperiment::configure(), iCubPalmTargetDistSensor::iCubPalmTargetDistSensor(), ObjectPositionSensor::ObjectPositionSensor(), EvoRobotExperiment::recreateNeuralNetwork(), ObjectPositionSensor::resourceChanged(), iCubHandJointsSensor::resourceChanged(), iCubHeadJointsSensor::resourceChanged(), iCubTorsoJointsSensor::resourceChanged(), iCubPalmTouchSensor::resourceChanged(), iCubPalmTargetDistSensor::resourceChanged(), iCubArmJointsSensor::resourceChanged(), Sensor::setName(), ObjectPositionSensor::update(), MarXbotGroundAroundIRSensor::update(), MarXbotGroundBottomIRSensor::update(), MarXbotProximityIRSensor::update(), HandObjectVisualOffsetSensor::update(), iCubPalmPatchesTouchSensor::update(), iCubFingertipsTouchSensor::update(), iCubHandJointsSensor::update(), iCubHeadJointsSensor::update(), iCubTorsoJointsSensor::update(), iCubHandTouchSensor::update(), iCubPalmTouchSensor::update(), iCubPalmTargetDistSensor::update(), ColorCameraSensor::update(), and iCubArmJointsSensor::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 77 of file neuroninterfaces.cpp.
Referenced by ObjectPositionSensor::resourceChanged(), MarXbotSensor::resourceChanged(), and iCubSensor::resourceChanged().
void save | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [virtual] |
Save the parameters into the ConfigurationParameters.
- Parameters:
-
params is the ConfigurationParameters where save the parameters prefix is the path prefix for the parameters to save
Implements ParameterSettable.
Reimplemented in iCubSensor, iCubArmJointsSensor, ColorCameraSensor, iCubPalmTargetDistSensor, iCubPalmTouchSensor, iCubHandTouchSensor, iCubTorsoJointsSensor, iCubHeadJointsSensor, iCubHandJointsSensor, iCubFingertipsTouchSensor, iCubPalmPatchesTouchSensor, HandObjectVisualOffsetSensor, MarXbotSensor, MarXbotProximityIRSensor, MarXbotGroundBottomIRSensor, MarXbotGroundAroundIRSensor, and ObjectPositionSensor.
Definition at line 40 of file neuroninterfaces.cpp.
References ConfigurationParameters::createParameter(), and ConfigurationParameters::startObjectParameters().
void setName | ( | QString | name | ) |
Use this method for changing the name of the Sensor.
Definition at line 58 of file neuroninterfaces.cpp.
References Sensor::name().
Referenced by EvoRobotExperiment::configure(), and Sensor::Sensor().
virtual int size | ( | ) | [pure virtual] |
Return the number of neurons on which the Sensor will set the input.
- Warning:
- this method has to be called in any situation; when re-implement it does not rely on conditions/variables available only after the initilization because this method might be called before the Sensor initialization
Implemented in iCubArmJointsSensor, ColorCameraSensor, iCubPalmTargetDistSensor, iCubPalmTouchSensor, iCubHandTouchSensor, iCubTorsoJointsSensor, iCubHeadJointsSensor, iCubHandJointsSensor, iCubFingertipsTouchSensor, iCubPalmPatchesTouchSensor, HandObjectVisualOffsetSensor, MarXbotProximityIRSensor, MarXbotGroundBottomIRSensor, MarXbotGroundAroundIRSensor, and ObjectPositionSensor.
Referenced by EvoRobotExperiment::recreateNeuralNetwork().
virtual void update | ( | ) | [pure virtual] |
Update the state of the Sensor every time step; the actual behaviour is implemented in subclasses.
Implemented in iCubArmJointsSensor, ColorCameraSensor, iCubPalmTargetDistSensor, iCubPalmTouchSensor, iCubHandTouchSensor, iCubTorsoJointsSensor, iCubHeadJointsSensor, iCubHandJointsSensor, iCubFingertipsTouchSensor, iCubPalmPatchesTouchSensor, HandObjectVisualOffsetSensor, MarXbotProximityIRSensor, MarXbotGroundBottomIRSensor, MarXbotGroundAroundIRSensor, and ObjectPositionSensor.
The documentation for this class was generated from the following files:
- experiments/include/neuroninterfaces.h
- experiments/src/neuroninterfaces.cpp