AGX Dynamics  2.35.0.1
SmoothingFilter.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 #ifndef AGXUTIL_SMOOTHINGFILTER_H
17 #define AGXUTIL_SMOOTHINGFILTER_H
18 
19 #include <agx/agxPhysics_export.h>
20 #include <agx/Math.h>
21 #include <agx/Referenced.h>
22 
23 namespace agxUtil
24 {
26  {
27  public:
29 
36  virtual agx::Real update( agx::Real observation, agx::Real s ) const = 0;
37 
38  protected:
39  virtual ~SmoothingFilter() {}
40  };
41 
43 
50  {
51  public:
56  VariableSmoothingFactorFilter( agx::Real maximumSmoothingFactor )
57  : m_maxSmoothingFactor( maximumSmoothingFactor ) {}
58 
66  virtual agx::Real update( agx::Real observation, agx::Real s ) const;
67 
72  {
73  return m_maxSmoothingFactor;
74  }
75 
80  void setMaximumSmoothingFactor( agx::Real maxSmoothingFactor )
81  {
82  m_maxSmoothingFactor = maxSmoothingFactor;
83  }
84 
85  protected:
87 
88  protected:
90  };
91 
93 
94 }
95 #endif
#define AGXPHYSICS_EXPORT
virtual agx::Real update(agx::Real observation, agx::Real s) const =0
Update statistic variable s with current observation observation.
Variable Smooth Factor Exponential Moving Average filter.
void setMaximumSmoothingFactor(agx::Real maxSmoothingFactor)
Set the maximum smoothing factor for this filter.
VariableSmoothingFactorFilter(agx::Real maximumSmoothingFactor)
Construct given maximum smoothing factor.
virtual agx::Real update(agx::Real observation, agx::Real s) const
Update the current statistic variable s given a new observation.
Base class providing referencing counted objects.
Definition: Referenced.h:114
The agxUtil namespace contain classes and methods for utility functionality.
agx::ref_ptr< SmoothingFilter > SmoothingFilterRef
agx::ref_ptr< VariableSmoothingFactorFilter > VariableSmoothingFactorFilterRef
double Real
Definition: Real.h:42