Gazebo Math

API Reference

7.5.1
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. More...
 
virtual ~MovingWindowFilter ()=default
 Destructor. More...
 
void SetWindowSize (const unsigned int _n)
 Set window size. More...
 
void Update (const T _val)
 Update value of filter. More...
 
Value () const
 Get filtered result. More...
 
bool WindowFilled () const
 Get whether the window has been filled. More...
 
unsigned int WindowSize () const
 Get the window size. More...
 

Public Attributes

unsigned int samples = 0
 keep track of number of elements More...
 
sum
 keep track of running sum More...
 
std::vector< T > valHistory
 buffer history of raw values More...
 
std::vector< T >::iterator valIter
 iterator pointing to current value in buffer More...
 
unsigned int valWindowSize = 4
 For moving window smoothed value. More...
 

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()

MovingWindowFilter ( unsigned int  _windowSize = 4)

Constructor.

◆ ~MovingWindowFilter()

virtual ~MovingWindowFilter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ SetWindowSize()

void SetWindowSize ( const unsigned int  _n)

Set window size.

Parameters
[in]_nnew desired window size

◆ Update()

void Update ( const T  _val)

Update value of filter.

Parameters
[in]_valnew raw value

◆ Value()

T Value ( ) const

Get filtered result.

Returns
Latest filtered value

◆ WindowFilled()

bool WindowFilled ( ) const

Get whether the window has been filled.

Returns
True if the window has been filled.

◆ WindowSize()

unsigned int WindowSize ( ) const

Get the window size.

Returns
The size of the moving window.

Member Data Documentation

◆ samples

unsigned int samples = 0

keep track of number of elements

◆ sum

T sum

keep track of running sum

◆ valHistory

std::vector<T> valHistory

buffer history of raw values

◆ valIter

std::vector<T>::iterator valIter

iterator pointing to current value in buffer

◆ valWindowSize

unsigned int valWindowSize = 4

For moving window smoothed value.


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