mc_filter::LeakyIntegrator< VectorT > Struct Template Reference

#include <mc_filter/LeakyIntegrator.h>

Public Member Functions

 LeakyIntegrator ()
 
void add (const VectorT &value, double dt)
 
const VectorT & eval () const
 
double rate () const
 
void rate (double rate)
 
void saturation (double s)
 
void reset ()
 

Detailed Description

template<typename VectorT>
struct mc_filter::LeakyIntegrator< VectorT >

Leaky integrator.

The output satisfies the differential equation:

\[ \dot{y}(t) = x(t) - leakRate * y(t) \]

A leaky integrator is implemented exactly as an exponential moving average, but it is homogeneous to the integral of the input signal (rather than the signal itself). See https://en.wikipedia.org/wiki/Leaky_integrator.

Expects VectorT to act as a vector (typically Eigen::Vector3d), supporting:

  • VectorT::Zero() static member function
  • VectorT::setZero() member
  • Component-wise math operator *
  • Access operator ()
  • VectorT::size()

Constructor & Destructor Documentation

◆ LeakyIntegrator()

template<typename VectorT >
mc_filter::LeakyIntegrator< VectorT >::LeakyIntegrator ( )
inline

Member Function Documentation

◆ add()

template<typename VectorT >
void mc_filter::LeakyIntegrator< VectorT >::add ( const VectorT &  value,
double  dt 
)
inline

Add constant input for a fixed duration.

Parameters
valueConstant input.
dtFixed duration.

◆ eval()

template<typename VectorT >
const VectorT& mc_filter::LeakyIntegrator< VectorT >::eval ( ) const
inline

Evaluate the output of the integrator.

◆ rate() [1/2]

template<typename VectorT >
double mc_filter::LeakyIntegrator< VectorT >::rate ( ) const
inline

Get leak rate.

◆ rate() [2/2]

template<typename VectorT >
void mc_filter::LeakyIntegrator< VectorT >::rate ( double  rate)
inline

Set the leak rate of the integrator.

Parameters
rateNew leak rate.

◆ reset()

template<typename VectorT >
void mc_filter::LeakyIntegrator< VectorT >::reset ( )
inline

Reset integral to zero.

◆ saturation()

template<typename VectorT >
void mc_filter::LeakyIntegrator< VectorT >::saturation ( double  s)
inline

Set output saturation. Disable by providing a negative value.

Parameters
sOutput will saturate between -s and +s.

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