Go to the documentation of this file.
31 double median_out = 0.0;
45 std::sort(vec_sorted.begin(), vec_sorted.end());
47 median_out = vec_sorted.at(vec_sorted.size() / 2);
61 double mean_out = 0.0;
69 mean_out = std::accumulate(
85 double std_dev_out = 0.0;
95 double sum_of_sq_diffs = 0;
99 sum_of_sq_diffs += std::pow(*it -
mean, 2);
101 std_dev_out = sqrt(sum_of_sq_diffs /
m_win_size);
119 return measurement > low_lim && measurement < upper_lim;
125 double threshold = this->
getMean();
126 return (value > threshold);
164 if (new_size < curr_size)
185 size_t sliding_win_size =
186 source.
read_int(section,
"sliding_win_size", 10,
false);
196 "-----------[ %s: Sliding Window Properties ]-----------\n",
198 out <<
"Measurements Vector: \n";
void addNewMeasurement(double measurement)
Update the sliding window by appending a new measurement.
double getStdDev()
Return the Standard deviation of the current measurement vector.
std::string m_name
Name of the TSlidingWindow Instance at hand.
double mean(const CONTAINER &v)
Computes the mean value of a vector.
bool m_std_dev_updated
Is the standard deviation up-to-date?
double m_median_cached
Cached median value.
size_t getWindowSize() const
Return the size of the window.
mrpt::vision::TStereoCalibResults out
double m_std_dev_cached
Cached version of the standard deviation.
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
int read_int(const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const
SLAM methods related to graphs of pose constraints.
bool m_mean_updated
Is the mean up-to-date?
This class allows loading and storing values and vectors of different types from a configuration text...
bool windowIsFull() const
Check if the window has reached its limit.
bool evaluateMeasurementBelow(double value)
Determine whether the incoming measurement is less or equal to the current mean value.
void resizeWindow(size_t new_size)
Resize the window.
TSlidingWindow(const std::string &name="window")
double getMedian()
Return the current median value.
bool m_is_initialized
flag is raised the first time that TSlidingWindow::addNewMeasurement is called
double getMean()
Return the current mean value.
bool evaluateMeasurementInGaussian(double measurement)
Determine whether the incoming measurement is inside the [-3sigma, +3sigma] boundaries from the curre...
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
bool m_median_updated
Is the median up-to-date?
std::vector< double > m_measurements_vec
bool evaluateMeasurementAbove(double value)
Determine whether the incoming measurement is over the current mean value.
double m_mean_cached
Cached mean value.
std::string std::string format(std::string_view fmt, ARGS &&... args)
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020 | |