Go to the documentation of this file.
28 #include <ArmarXCore/interface/observers/Filters.h>
44 public GaussianFilterBase
57 template <
typename Type>
60 const double sigma = filterSizeInMs / 2.5;
63 double weightedSum = 0;
64 double sumOfWeight = 0;
67 const double sqrt2PI =
sqrt(2 *
M_PI);
70 for (
auto it = map.begin();
76 value = VariantPtr::dynamicCast(it->second)->get<
Type>();
77 double diff = 0.001 * (it->first - map.rbegin()->first);
79 double squared = diff * diff;
80 const double gaussValue = exp(-squared / (2 * sigma * sigma)) / (sigma * sqrt2PI);
81 sumOfWeight += gaussValue;
82 weightedSum += gaussValue *
value;
87 result = weightedSum / sumOfWeight;
97 ParameterTypeList
getSupportedTypes(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
103 StringFloatDictionary
getProperties(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
104 void setProperties(
const StringFloatDictionary& newValues,
const Ice::Current&
c = Ice::emptyCurrent)
override;
VectorXD< D, T > sqrt(const VectorXD< D, T > &a)
The DatafieldFilter class is the base class for all filters and filter implementation should derive f...
std::deque< std::pair< long, VariantBasePtr > > TimeVariantBaseMap
StringFloatDictionary getProperties(const Ice::Current &c=Ice::emptyCurrent) const override
void setProperties(const StringFloatDictionary &newValues, const Ice::Current &c=Ice::emptyCurrent) override
The GaussianFilter class provides a filter implemtentation with gaussian weighted values for datafiel...
std::shared_ptr< Value > value()
VariantBasePtr calculate(const Ice::Current &c=Ice::emptyCurrent) const override
ParameterTypeList getSupportedTypes(const Ice::Current &c=Ice::emptyCurrent) const override
This filter supports: Int, Long, Float, Double.
GaussianFilter(int filterSizeInMs=200, int windowSize=20)
GaussianFilter.
Type calcGaussianFilteredValue(const TimeVariantBaseMap &map) const