Noise.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 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 #ifndef SDF_NOISE_HH_
18 #define SDF_NOISE_HH_
19 
20 #include <sdf/Error.hh>
21 #include <sdf/Element.hh>
22 #include <sdf/sdf_config.h>
23 
24 namespace sdf
25 {
26  // Inline bracke to help doxygen filtering.
27  inline namespace SDF_VERSION_NAMESPACE {
28  // Forward declare private data class.
29  class NoisePrivate;
30 
33  enum class NoiseType
34  {
36  NONE = 0,
37 
40  GAUSSIAN = 1,
41 
44  };
45 
50  {
52  public: Noise();
53 
56  public: Noise(const Noise &_noise);
57 
60  public: Noise(Noise &&_noise) noexcept;
61 
63  public: ~Noise();
64 
68  public: Noise &operator=(const Noise &_noise);
69 
73  public: Noise &operator=(Noise &&_noise);
74 
78  public: bool operator==(const Noise &_noise) const;
79 
83  public: bool operator!=(const Noise &_noise) const;
84 
91  public: Errors Load(ElementPtr _sdf);
92 
95  public: NoiseType Type() const;
96 
99  public: void SetType(NoiseType _type);
100 
105  public: double Mean() const;
106 
111  public: void SetMean(double _mean);
112 
117  public: double StdDev() const;
118 
123  public: void SetStdDev(double _stddev);
124 
129  public: double BiasMean() const;
130 
135  public: void SetBiasMean(double _bias);
136 
141  public: double BiasStdDev() const;
142 
148  public: void SetBiasStdDev(double _bias);
149 
153  public: double Precision() const;
154 
158  public: void SetPrecision(double _precision);
159 
163  public: double DynamicBiasStdDev() const;
164 
168  public: void SetDynamicBiasStdDev(double _stddev);
169 
173  public: double DynamicBiasCorrelationTime() const;
174 
180  public: void SetDynamicBiasCorrelationTime(double _time);
181 
186  public: sdf::ElementPtr Element() const;
187 
189  private: NoisePrivate *dataPtr;
190  };
191  }
192 }
193 #endif
NoiseType
The set of noise types.
Definition: Noise.hh:33
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
Gaussian noise plus quantization of outputs (ie. rounding).
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
The Noise class contains information about a noise model, such as a Gaussian distribution.
Definition: Noise.hh:49
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:89
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
namespace for Simulation Description Format parser
Definition: Actor.hh:32
Draw noise values independently for each measurement from a Gaussian distribution.