Public Member Functions | Protected Attributes | List of all members
FirstOrderFilter< T > Class Template Reference

This class can be used to apply a first order filter on a signal. It allows different acceleration and deceleration time constants. More...

#include <common.h>

Public Member Functions

 FirstOrderFilter (double timeConstantUp, double timeConstantDown, T initialState)
 
updateFilter (T inputState, double samplingTime)
 This method will apply a first order filter on the inputState. More...
 
 ~FirstOrderFilter ()
 

Protected Attributes

previousState_
 
double timeConstantDown_
 
double timeConstantUp_
 

Detailed Description

template<typename T>
class FirstOrderFilter< T >

This class can be used to apply a first order filter on a signal. It allows different acceleration and deceleration time constants.

Short reveiw of discrete time implementation of first order system: Laplace: X(s)/U(s) = 1/(tau*s + 1) continous time system: dx(t) = (-1/tau)*x(t) + (1/tau)*u(t) discretized system (ZoH): x(k+1) = exp(samplingTime*(-1/tau))*x(k) + (1 - exp(samplingTime*(-1/tau))) * u(k)

Definition at line 148 of file common.h.

Constructor & Destructor Documentation

◆ FirstOrderFilter()

template<typename T >
FirstOrderFilter< T >::FirstOrderFilter ( double  timeConstantUp,
double  timeConstantDown,
initialState 
)
inline

Definition at line 151 of file common.h.

◆ ~FirstOrderFilter()

template<typename T >
FirstOrderFilter< T >::~FirstOrderFilter ( )
inline

Definition at line 177 of file common.h.

Member Function Documentation

◆ updateFilter()

template<typename T >
T FirstOrderFilter< T >::updateFilter ( inputState,
double  samplingTime 
)
inline

This method will apply a first order filter on the inputState.

Definition at line 157 of file common.h.

Member Data Documentation

◆ previousState_

template<typename T >
T FirstOrderFilter< T >::previousState_
protected

Definition at line 182 of file common.h.

◆ timeConstantDown_

template<typename T >
double FirstOrderFilter< T >::timeConstantDown_
protected

Definition at line 181 of file common.h.

◆ timeConstantUp_

template<typename T >
double FirstOrderFilter< T >::timeConstantUp_
protected

Definition at line 180 of file common.h.


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


rotors_gazebo_plugins
Author(s): Fadri Furrer, Michael Burri, Mina Kamel, Janosch Nikolic, Markus Achtelik
autogenerated on Mon Feb 28 2022 23:39:04