mc_filter::LowPass< T > Struct Template Reference

#include <mc_filter/LowPass.h>

Inheritance diagram for mc_filter::LowPass< T >:

Public Member Functions

 LowPass (double dt, double period=0)
 
double cutoffPeriod () const
 
void cutoffPeriod (double period)
 
void reset (const T &value)
 
void update (const T &newValue)
 
const T & eval () const
 
double dt () const
 
void dt (double dt)
 

Protected Attributes

double dt_ = 0.005
 

Detailed Description

template<typename T>
struct mc_filter::LowPass< T >

Low-pass filter from series of velocity measurements.

Expects T to have:

  • T::Zero() static method (e.g Eigen::Vector3d, etc)

Constructor & Destructor Documentation

◆ LowPass()

template<typename T >
mc_filter::LowPass< T >::LowPass ( double  dt,
double  period = 0 
)
inline

Constructor with cutoff period.

Parameters
dtSampling period.
periodCutoff period.

Member Function Documentation

◆ cutoffPeriod() [1/2]

template<typename T >
double mc_filter::LowPass< T >::cutoffPeriod ( ) const
inline

Get cutoff period.

◆ cutoffPeriod() [2/2]

template<typename T >
void mc_filter::LowPass< T >::cutoffPeriod ( double  period)
inline

Set cutoff period.

Parameters
periodNew cutoff period.
Note
period is explicitely enforced to respect the Nyquist–Shannon sampling theorem, that is T is at least 2*timestep.

◆ dt() [1/2]

template<typename T >
double mc_filter::LowPass< T >::dt ( ) const
inline

Get sampling period.

◆ dt() [2/2]

template<typename T >
void mc_filter::LowPass< T >::dt ( double  dt)
inline

Set sampling period.

Parameters
dtSampling period.
Note
the cutoff period is updated to satisfy the Nyquist–Shannon sampling theorem according the new sampling period.

◆ eval()

template<typename T >
const T& mc_filter::LowPass< T >::eval ( ) const
inline

Get filtered velocity.

◆ reset()

template<typename T >
void mc_filter::LowPass< T >::reset ( const T &  value)
inline

Reset position to an initial rest value.

Parameters
posNew position.

◆ update()

template<typename T >
void mc_filter::LowPass< T >::update ( const T &  newValue)
inline

Update velocity estimate from new position value.

Parameters
newPosNew observed position.

Member Data Documentation

◆ dt_

template<typename T >
double mc_filter::LowPass< T >::dt_ = 0.005
protected

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