MovingWindowFilter< T > Class Template Reference
Base class for MovingWindowFilter. This replaces the version of MovingWindowFilter in the Gazebo Common library. More...
#include <MovingWindowFilter.hh>
Public Member Functions | |
MovingWindowFilter (unsigned int _windowSize=4) | |
Constructor. | |
virtual | ~MovingWindowFilter ()=default |
Destructor. | |
void | SetWindowSize (const unsigned int _n) |
Set window size. | |
void | Update (const T _val) |
Update value of filter. | |
T | Value () const |
Get filtered result. | |
bool | WindowFilled () const |
Get whether the window has been filled. | |
unsigned int | WindowSize () const |
Get the window size. | |
Public Attributes | |
unsigned int | samples = 0 |
keep track of number of elements | |
T | sum |
keep track of running sum | |
std::vector< T > | valHistory |
buffer history of raw values | |
std::vector< T >::iterator | valIter |
iterator pointing to current value in buffer | |
unsigned int | valWindowSize = 4 |
For moving window smoothed value. | |
Detailed Description
template<typename T>
class gz::math::MovingWindowFilter< T >
class gz::math::MovingWindowFilter< T >
Base class for MovingWindowFilter. This replaces the version of MovingWindowFilter in the Gazebo Common library.
The default window size is 4.
Constructor & Destructor Documentation
◆ MovingWindowFilter()
template<typename T >
MovingWindowFilter | ( | unsigned int | _windowSize = 4 | ) |
Constructor.
◆ ~MovingWindowFilter()
template<typename T >
|
virtualdefault |
Destructor.
Member Function Documentation
◆ SetWindowSize()
Set window size.
- Parameters
-
[in] _n new desired window size
◆ Update()
Update value of filter.
- Parameters
-
[in] _val new raw value
◆ Value()
template<typename T >
T Value | ( | ) | const |
Get filtered result.
- Returns
- Latest filtered value
◆ WindowFilled()
Get whether the window has been filled.
- Returns
- True if the window has been filled.
◆ WindowSize()
Get the window size.
- Returns
- The size of the moving window.
Member Data Documentation
◆ samples
◆ sum
template<typename T >
T sum |
keep track of running sum
◆ valHistory
template<typename T >
std::vector<T> valHistory |
buffer history of raw values
◆ valIter
template<typename T >
std::vector<T>::iterator valIter |
iterator pointing to current value in buffer
◆ valWindowSize
The documentation for this class was generated from the following file: