SignalStats.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 _GAZEBO_SIGNAL_STATS_HH_
18 #define _GAZEBO_SIGNAL_STATS_HH_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 #include <ignition/math/SignalStats.hh>
24 #include "gazebo/util/system.hh"
25 
26 #ifndef _WIN32
27 #pragma GCC diagnostic push
28 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29 #endif
30 
31 namespace gazebo
32 {
33  namespace math
34  {
37 
39  class SignalStatisticPrivate;
40 
43  class GZ_MATH_VISIBLE SignalStatistic
44  {
47  public: SignalStatistic() GAZEBO_DEPRECATED(8.0);
48 
50  public: virtual ~SignalStatistic();
51 
55  public: SignalStatistic(const SignalStatistic &_ss)
56  GAZEBO_DEPRECATED(8.0);
57 
60  public: virtual double Value() const = 0;
61 
64  public: virtual std::string ShortName() const = 0;
65 
68  public: virtual size_t Count() const;
69 
72  public: virtual void InsertData(const double _data) = 0;
73 
75  public: virtual void Reset();
76 
78  protected: std::unique_ptr<SignalStatisticPrivate> dataPtr;
79  };
81 
84  class GZ_MATH_VISIBLE SignalMean : public SignalStatistic
85  {
86  // Documentation inherited.
87  public: virtual double Value() const;
88 
91  public: virtual std::string ShortName() const;
92 
93  // Documentation inherited.
94  public: virtual void InsertData(const double _data);
95  };
97 
101  class GZ_MATH_VISIBLE SignalRootMeanSquare : public SignalStatistic
102  {
103  // Documentation inherited.
104  public: virtual double Value() const;
105 
108  public: virtual std::string ShortName() const;
109 
110  // Documentation inherited.
111  public: virtual void InsertData(const double _data);
112  };
114 
119  class GZ_MATH_VISIBLE SignalMaxAbsoluteValue : public SignalStatistic
120  {
121  // Documentation inherited.
122  public: virtual double Value() const;
123 
126  public: virtual std::string ShortName() const;
127 
128  // Documentation inherited.
129  public: virtual void InsertData(const double _data);
130  };
132 
134  class SignalStatsPrivate;
135 
138  class GZ_MATH_VISIBLE SignalStats
139  {
142  public: SignalStats() GAZEBO_DEPRECATED(8.0);
143 
146  public: SignalStats(const ignition::math::SignalStats &_s);
147 
149  public: ~SignalStats();
150 
154  public: SignalStats(const SignalStats &_ss)
155  GAZEBO_DEPRECATED(8.0);
156 
162  public: size_t Count() const;
163 
168  public: std::map<std::string, double> Map() const;
169 
172  public: void InsertData(const double _data);
173 
183  public: bool InsertStatistic(const std::string &_name);
184 
192  public: bool InsertStatistics(const std::string &_names);
193 
195  public: void Reset();
196 
199  public: ignition::math::SignalStats Ign() const;
200 
204  public: SignalStats &operator=(const ignition::math::SignalStats &_s);
205 
207  protected: std::unique_ptr<SignalStatsPrivate> dataPtr;
208  };
210  }
211 }
212 #ifndef _WIN32
213 #pragma GCC diagnostic pop
214 #endif
215 #endif
216 
Computing the mean value of a discretely sampled signal.
Definition: SignalStats.hh:84
static const double GAZEBO_DEPRECATED(8.0) MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:140
std::unique_ptr< SignalStatsPrivate > dataPtr
Pointer to private data.
Definition: SignalStats.hh:207
Collection of statistics for a scalar signal.
Definition: SignalStats.hh:138
Computing the square root of the mean squared value of a discretely sampled signal.
Definition: SignalStats.hh:101
std::unique_ptr< SignalStatisticPrivate > dataPtr
Pointer to private data.
Definition: SignalStats.hh:78
Computing the maximum of the absolute value of a discretely sampled signal.
Definition: SignalStats.hh:119
Statistical properties of a discrete time scalar signal.
Definition: SignalStats.hh:43