GaussianNoiseModel.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef _GAZEBO_GAUSSIAN_NOISE_MODEL_HH_
19#define _GAZEBO_GAUSSIAN_NOISE_MODEL_HH_
20
21#include <vector>
22#include <string>
23
24#include <sdf/sdf.hh>
25
28#include "gazebo/util/system.hh"
29
30namespace Ogre
31{
32 class CompositorInstance;
33}
34
35namespace gazebo
36{
37 class GaussianNoiseCompositorListener;
38
39 namespace sensors
40 {
43 class GZ_SENSORS_VISIBLE GaussianNoiseModel : public Noise
44 {
47
49 public: virtual ~GaussianNoiseModel();
50
51 // Documentation inherited.
52 public: virtual void Load(sdf::ElementPtr _sdf);
53
54 // Documentation inherited.
55 public: virtual void Fini();
56
57 // Documentation inherited.
58 public: double ApplyImpl(double _in, double _dt);
59
62 public: double GetMean() const;
63
66 public: double GetStdDev() const;
67
70 public: double GetBias() const;
71
74 public: double GetDynamicBiasStdDev() const;
75
78 public: double GetDynamicBiasCorrelationTime() const;
79
82 public: void SetMean(const double _mean);
83
86 public: void SetStdDev(const double _stddev);
87
90 public: void SetDynamicBiasStdDev(const double _stddev);
91
94 public: void SetDynamicBiasCorrelationTime(const double _stddev);
95
97 public: virtual void Print(std::ostream &_out) const;
98
100 private: void SampleBias();
101
104 protected: double mean;
105
108 protected: double stdDev;
109
111 protected: double bias;
112
115 protected: double precision;
116
118 protected: bool quantized;
119
122 private: double biasMean;
123
126 private: double biasStdDev;
127
130 private: double dynamicBiasStdDev;
131
134 private: double dynamicBiasCorrTime;
135 };
136
139 class GZ_SENSORS_VISIBLE ImageGaussianNoiseModel : public GaussianNoiseModel
140 {
143
145 public: virtual ~ImageGaussianNoiseModel();
146
147 // Documentation inherited.
148 public: virtual void Load(sdf::ElementPtr _sdf);
149
150 // Documentation inherited.
151 public: virtual void Fini();
152
153 // Documentation inherited.
154 public: virtual void SetCamera(rendering::CameraPtr _camera);
155
157 public: virtual void Print(std::ostream &_out) const;
158
160 public: Ogre::CompositorInstance *gaussianNoiseInstance;
161
163 public: boost::shared_ptr<GaussianNoiseCompositorListener>
165 };
167 }
168}
169
170#endif
sensors
Definition SensorManager.hh:37
Gaussian noise class.
Definition GaussianNoiseModel.hh:44
double GetDynamicBiasCorrelationTime() const
Accessor for dynamic bias process correlation time (seconds).
bool quantized
True if the type is GAUSSIAN_QUANTIZED.
Definition GaussianNoiseModel.hh:118
virtual void Fini()
Finalize the noise model.
void SetDynamicBiasStdDev(const double _stddev)
Set standard deviation of dynamic bias process.
double GetBias() const
Accessor for bias.
double ApplyImpl(double _in, double _dt)
Apply noise to input data value.
virtual ~GaussianNoiseModel()
Destructor.
void SetMean(const double _mean)
Set mean.
double GetMean() const
Accessor for mean.
double GetStdDev() const
Accessor for stddev.
double GetDynamicBiasStdDev() const
Accessor for dynamic bias process standard deviation.
double precision
If type==GAUSSIAN_QUANTIZED, the precision to which the output signal is rounded.
Definition GaussianNoiseModel.hh:115
void SetStdDev(const double _stddev)
Set stddev.
double bias
If type starts with GAUSSIAN, the bias we'll add.
Definition GaussianNoiseModel.hh:111
double mean
If type starts with GAUSSIAN, the mean of the distribution from which we sample when adding noise.
Definition GaussianNoiseModel.hh:104
void SetDynamicBiasCorrelationTime(const double _stddev)
Set correlation time of dynamic bias process, in seconds.
virtual void Load(sdf::ElementPtr _sdf)
Load noise parameters from sdf.
virtual void Print(std::ostream &_out) const
Documentation inherited.
double stdDev
If type starts with GAUSSIAN, the standard deviation of the distribution from which we sample when ad...
Definition GaussianNoiseModel.hh:108
Definition GaussianNoiseModel.hh:140
virtual void Fini()
Finalize the noise model.
virtual ~ImageGaussianNoiseModel()
Destructor.
virtual void SetCamera(rendering::CameraPtr _camera)
Set camera needed to create image noise.
boost::shared_ptr< GaussianNoiseCompositorListener > gaussianNoiseCompositorListener
Gaussian noise compositor listener.
Definition GaussianNoiseModel.hh:164
virtual void Load(sdf::ElementPtr _sdf)
Load noise parameters from sdf.
Ogre::CompositorInstance * gaussianNoiseInstance
Gaussian noise compositor.
Definition GaussianNoiseModel.hh:160
virtual void Print(std::ostream &_out) const
Documentation inherited.
Noise models for sensor output signals.
Definition Noise.hh:56
Definition JointMaker.hh:40
boost::shared_ptr< Camera > CameraPtr
Definition RenderTypes.hh:90
Forward declarations for the common classes.
Definition Animation.hh:27