Gazebo Math

API Reference

8.0.0
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.
 
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
 
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 >

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 >
virtual ~MovingWindowFilter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ SetWindowSize()

template<typename T >
void SetWindowSize ( const unsigned int  _n)

Set window size.

Parameters
[in]_nnew desired window size

◆ Update()

template<typename T >
void Update ( const _val)

Update value of filter.

Parameters
[in]_valnew raw value

◆ Value()

template<typename T >
T Value ( ) const

Get filtered result.

Returns
Latest filtered value

◆ WindowFilled()

template<typename T >
bool WindowFilled ( ) const

Get whether the window has been filled.

Returns
True if the window has been filled.

◆ WindowSize()

template<typename T >
unsigned int WindowSize ( ) const

Get the window size.

Returns
The size of the moving window.

Member Data Documentation

◆ samples

template<typename T >
unsigned int samples = 0

keep track of number of elements

◆ 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

template<typename T >
unsigned int valWindowSize = 4

For moving window smoothed value.


The documentation for this class was generated from the following file: