The base abstract class for devices (sensors and motors) with noise. More...
Public Member Functions | |
NoisyDevice (ConfigurationParameters ¶ms, QString prefix) | |
Constructor and Configure. More... | |
~NoisyDevice () | |
Destructor. More... | |
void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the parameters into the ConfigurationParameters. More... | |
Public Member Functions inherited from ParameterSettableInConstructor | |
ParameterSettableInConstructor (ConfigurationParameters &, QString) | |
Public Member Functions inherited from ParameterSettable | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Static Public Member Functions | |
static void | describe (QString type) |
Describe all the parameter for configuring the Sensor. More... | |
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 | |
double | applyNoise (double v, double minValue, double maxValue) const |
Adds noise to the value. More... | |
Protected Member Functions inherited from ParameterSettable | |
void | notifyChangesToParam (QString paramName) |
Additional Inherited Members | |
Public Types inherited from ParameterSettable | |
enum | Property |
Public Attributes inherited from ParameterSettable | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
Static Public Attributes inherited from ParameterSettable | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
Static Protected Member Functions inherited from ParameterSettable | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
Detailed Description
The base abstract class for devices (sensors and motors) with noise.
This class provides parameters and a function to add noise. You can add either uniform noise or gaussian noise in a range. The parameters regarding noise are:
- noiseType: set to either NoNoise, Uniform or Gaussian to select the type of distribution of noise (respectively no noise, uniform noise in a range or gaussian noise)
- noiseRange: the range of noise. For uniform noise this is the actual range, (the distribution has zero mean and goes from -noiseRange/2 to noiseRange/2). For gaussian noise, this is four times the standard deviation (the distribution has zero mean and noiseRange/4 standard deviation: this means that about 95% of the values taken from the distribution will be between -noiseRange/2 and noiseRange/2) To apply noise in the code you have to use the applyNoise() function. The function takes the value to which noise should be applied and the expected range of the value and returns the value with added noise.
Definition at line 113 of file neuroninterfaces.h.
Constructor & Destructor Documentation
NoisyDevice | ( | 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 31 of file neuroninterfaces.cpp.
References ConfigurationHelper::getDouble(), ConfigurationHelper::getString(), ConfigurationParameters::getValue(), and ConfigurationHelper::throwUserConfigError().
~NoisyDevice | ( | ) |
Destructor.
Definition at line 66 of file neuroninterfaces.cpp.
Member Function Documentation
|
protected |
Adds noise to the value.
This function applies the noise as configured by configuration parameters. If minValue > maxValue no check on boundaries is performed (i.e. we don't restrict the value obtained after applying noise)
- Parameters
-
v the value to which noise should be added minValue the minimum allowed value maxValue the maximum allowed value
- Returns
- the value with added noise
Definition at line 96 of file neuroninterfaces.cpp.
References RandomGenerator::getDouble(), RandomGenerator::getGaussian(), and farsa::globalRNG.
Referenced by EpuckWheelVelocityMotor::update(), KheperaWheelVelocityMotor::update(), MarXbotWheelVelocityMotor::update(), EpuckProximityIRSensor::update(), KheperaProximityIRSensor::update(), MarXbotProximityIRSensor::update(), MarXbotWheelVelOrient::update(), EpuckGroundIRSensor::update(), KheperaSampledProximityIRSensor::update(), MarXbotGroundBottomIRSensor::update(), EpuckLinearCameraSensor::update(), MarXbotGroundAroundIRSensor::update(), KheperaSampledLightSensor::update(), MarXbotLinearCameraSensor::update(), KheperaGroundSensor::update(), EpuckSampledProximityIRSensor::update(), KheperaWheelSpeedsSensor::update(), MarXbotLinearCameraSensorNew::update(), MarXbotTractionSensor::update(), MarXbotSampledProximityIRSensor::update(), MarXbotWheelSpeedsSensor::update(), MarXbotLaserFrontDistanceSensor::update(), and MarXbotLaserOmniDistanceSensor::update().
|
static |
Describe all the parameter for configuring the Sensor.
- Parameters
-
type the name of the type
Definition at line 89 of file neuroninterfaces.cpp.
References ParameterSettable::addTypeDescription(), and ParameterSettable::Infinity.
Referenced by Sensor::describe(), and Motor::describe().
|
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 Motor, Sensor, ObjectPositionSensor, and FakeSensor.
Definition at line 70 of file neuroninterfaces.cpp.
References ConfigurationParameters::createParameter(), and ConfigurationParameters::startObjectParameters().
Referenced by Sensor::save(), and Motor::save().
The documentation for this class was generated from the following files:
- experiments/include/neuroninterfaces.h
- experiments/src/neuroninterfaces.cpp