Noise Class Reference

Noise models for sensor output signals. More...

#include <Noise.hh>

Inherited by GaussianNoiseModel.

Public Types

enum  NoiseType { NONE, CUSTOM, GAUSSIAN }
 Which noise types we support. More...
 

Public Member Functions

 Noise (NoiseType _type)
 Constructor. More...
 
virtual ~Noise ()
 Destructor. More...
 
double Apply (double _in, double _dt=0.0)
 Apply noise to input data value. More...
 
virtual double ApplyImpl (double _in, double _dt=0.0)
 Apply noise to input data value. More...
 
virtual void Fini ()
 Finalize the noise model. More...
 
NoiseType GetNoiseType () const
 Accessor for NoiseType. More...
 
virtual void Load (sdf::ElementPtr _sdf)
 Load noise parameters from sdf. More...
 
virtual void Print (std::ostream &_out) const
 Output information about the noise model. More...
 
virtual void SetCamera (rendering::CameraPtr _camera)
 Set camera needed to create image noise. More...
 
virtual void SetCustomNoiseCallback (boost::function< double(double)> _cb)
 Register a custom noise callback. More...
 
virtual void SetCustomNoiseCallbackTime (boost::function< double(double, double)> _cb)
 Register a custom noise callback, with time. More...
 

Detailed Description

Noise models for sensor output signals.

Member Enumeration Documentation

◆ NoiseType

enum NoiseType

Which noise types we support.

Enumerator
NONE 
CUSTOM 
GAUSSIAN 

Constructor & Destructor Documentation

◆ Noise()

Noise ( NoiseType  _type)
explicit

Constructor.

This should not be called directly unless creating an empty noise model. Use NoiseFactory::NewNoiseModel to instantiate a new noise model.

Parameters
[in]_typeType of noise model.
See also
NoiseFactory::NewNoiseModel

◆ ~Noise()

virtual ~Noise ( )
virtual

Destructor.

Member Function Documentation

◆ Apply()

double Apply ( double  _in,
double  _dt = 0.0 
)

Apply noise to input data value.

Parameters
[in]_inInput data value.
Returns
Data with noise applied.

◆ ApplyImpl()

virtual double ApplyImpl ( double  _in,
double  _dt = 0.0 
)
virtual

Apply noise to input data value.

This gets overriden by derived classes, and called by Apply.

Parameters
[in]_inInput data value.
Returns
Data with noise applied.

Reimplemented in GaussianNoiseModel.

◆ Fini()

virtual void Fini ( )
virtual

Finalize the noise model.

Reimplemented in ImageGaussianNoiseModel, and GaussianNoiseModel.

◆ GetNoiseType()

NoiseType GetNoiseType ( ) const

Accessor for NoiseType.

Returns
Type of noise currently in use.

◆ Load()

virtual void Load ( sdf::ElementPtr  _sdf)
virtual

Load noise parameters from sdf.

Parameters
[in]_sdfSDF parameters.
[in]_sensorType of sensor.

Reimplemented in ImageGaussianNoiseModel, and GaussianNoiseModel.

◆ Print()

virtual void Print ( std::ostream &  _out) const
virtual

Output information about the noise model.

Parameters
[in]_outOutput stream

Reimplemented in ImageGaussianNoiseModel, and GaussianNoiseModel.

◆ SetCamera()

virtual void SetCamera ( rendering::CameraPtr  _camera)
virtual

Set camera needed to create image noise.

This is only needed for image sensors, i.e. camera/multicamera/depth sensors, which use shaders for more efficient noise generation.

Parameters
[in]_cameraCamera associated to an image sensor

Reimplemented in ImageGaussianNoiseModel.

◆ SetCustomNoiseCallback()

virtual void SetCustomNoiseCallback ( boost::function< double(double)>  _cb)
virtual

Register a custom noise callback.

If both a function that takes time and one that doesn't are set, the one without time will be ignored.

Parameters
[in]_cbCallback function for applying a custom noise model. This is useful if users want to use their own noise model from a sensor plugin.

◆ SetCustomNoiseCallbackTime()

virtual void SetCustomNoiseCallbackTime ( boost::function< double(double, double)>  _cb)
virtual

Register a custom noise callback, with time.

If both a function that takes time and one that doesn't are set, the one without time will be ignored.

Parameters
[in]_cbCallback function for applying a custom noise model. This is useful if users want to use their own noise model from a sensor plugin.

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