LocalGuidance
A library that generates velocity references to follow a path.
robot_utils::FilterMovAvg< ValueType_ > Class Template Reference

#include <FilterMovAvg.hpp>

Public Member Functions

 FilterMovAvg ()
 
 FilterMovAvg (const unsigned int nSamples, const ValueType_ &initValue=getDefaultValue< ValueType_ >())
 
virtual ~FilterMovAvg ()=default
 
void setFilterParameters (unsigned int nSamples, const ValueType_ &resetValue=getDefaultValue< ValueType_ >())
 
void reset (const ValueType_ &y_0=getDefaultValue< ValueType_ >())
 
ValueType_ advance (const ValueType_ &u_k)
 
ValueType_ getFilteredValue () const
 

Private Attributes

VectorType< ValueType_ > samples_
 
unsigned int index_
 
ValueType_ sum_
 

Constructor & Destructor Documentation

template<typename ValueType_ >
robot_utils::FilterMovAvg< ValueType_ >::FilterMovAvg ( )
inline
template<typename ValueType_ >
robot_utils::FilterMovAvg< ValueType_ >::FilterMovAvg ( const unsigned int  nSamples,
const ValueType_ &  initValue = getDefaultValue<ValueType_>() 
)
inline
Parameters
nSamplesnumber of samples of the window
template<typename ValueType_ >
virtual robot_utils::FilterMovAvg< ValueType_ >::~FilterMovAvg ( )
virtualdefault

Member Function Documentation

template<typename ValueType_ >
ValueType_ robot_utils::FilterMovAvg< ValueType_ >::advance ( const ValueType_ &  u_k)
inline

Filter new Values

Parameters
u_knew input Value
Returns
filtered value
template<typename ValueType_ >
ValueType_ robot_utils::FilterMovAvg< ValueType_ >::getFilteredValue ( ) const
inline
Returns
last calculated output of the filter
template<typename ValueType_ >
void robot_utils::FilterMovAvg< ValueType_ >::reset ( const ValueType_ &  y_0 = getDefaultValue<ValueType_>())
inline

Reset the filter

Parameters
resetValuevalue to reset the filter to
template<typename ValueType_ >
void robot_utils::FilterMovAvg< ValueType_ >::setFilterParameters ( unsigned int  nSamples,
const ValueType_ &  resetValue = getDefaultValue<ValueType_>() 
)
inline

Resize the filter window and reset

Parameters
nSamplesnumber of samples

Member Data Documentation

template<typename ValueType_ >
unsigned int robot_utils::FilterMovAvg< ValueType_ >::index_
private
template<typename ValueType_ >
VectorType<ValueType_> robot_utils::FilterMovAvg< ValueType_ >::samples_
private
template<typename ValueType_ >
ValueType_ robot_utils::FilterMovAvg< ValueType_ >::sum_
private

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