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

First order discrete time derivative filter implementation. More...

#include <FirstOrderDerivative.hpp>

Inheritance diagram for robot_utils::FirstOrderDerivative< ValueType_ >:
Inheritance graph

Public Types

using BaseType = ContinuousTimeTransferFunction< ValueType_, 1 >
 
- Public Types inherited from robot_utils::ContinuousTimeTransferFunction< ValueType_, 1 >
using BaseType = DiscreteTimeTransferFunction< ValueType_, Order_ >
 
using CoefficientArray = typename BaseType::CoefficientArray
 
- Public Types inherited from robot_utils::DiscreteTimeTransferFunction< ValueType_, Order_ >
using CoefficientArray = std::array< double, Size_ >
 

Public Member Functions

 FirstOrderDerivative ()
 
 FirstOrderDerivative (const double dt, const double continuousTimeConstant, const double gain, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
 ~FirstOrderDerivative () override=default
 
void setFilterParameters (const double dt, const double continuousTimeConstant, const double gain, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
void setSamplingTime (const double dt, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
void setContinuousTimeConstant (const double continuousTimeConstant, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
void setGain (const double gain, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
const ValueType_ & getFilteredValue () const
 
- Public Member Functions inherited from robot_utils::ContinuousTimeTransferFunction< ValueType_, 1 >
 ContinuousTimeTransferFunction ()=default
 
 ContinuousTimeTransferFunction (const double dt, const CoefficientArray &ctNumeratorCoefficients, const CoefficientArray &ctDenominatorCoefficients, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
 ~ContinuousTimeTransferFunction () override=default
 
void setContinuousTimeCoefficients (const double dt, const CoefficientArray &ctNumeratorCoefficients, const CoefficientArray &ctDenominatorCoefficients, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
- Public Member Functions inherited from robot_utils::DiscreteTimeTransferFunction< ValueType_, Order_ >
 DiscreteTimeTransferFunction ()=default
 
 DiscreteTimeTransferFunction (const CoefficientArray &numeratorCoefficients, const CoefficientArray &denominatorCoefficients, const ValueType_ &y0=getDefaultValue< ValueType_ >())
 
virtual ~DiscreteTimeTransferFunction ()=default
 
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF (traits::is_eigen_matrix< ValueType_ >::value) inline void setCoefficients(const CoefficientArray &numeratorCoefficients
 

Protected Attributes

double dt_
 Sample time. More...
 
double tau_
 The time constant tau of the CT system. More...
 
double mu0_
 The steady state gain of the CT system. More...
 

Additional Inherited Members

- Public Attributes inherited from robot_utils::DiscreteTimeTransferFunction< ValueType_, Order_ >
const CoefficientArraydenominatorCoefficients
 
const CoefficientArray const ValueType_ & y0
 
const CoefficientArray const ValueType_ Size_ input_
 
std::array< ValueType_, Size_output_
 
CoefficientArray numeratorCoefficients_
 
CoefficientArray denominatorCoefficients_
 
double invA_n_ = 1.0
 
- Static Public Attributes inherited from robot_utils::ContinuousTimeTransferFunction< ValueType_, 1 >
static constexpr unsigned int Size_
 
- Static Public Attributes inherited from robot_utils::DiscreteTimeTransferFunction< ValueType_, Order_ >
static constexpr unsigned int Size_ = Order_+1
 

Detailed Description

template<typename ValueType_>
class robot_utils::FirstOrderDerivative< ValueType_ >

First order discrete time derivative filter implementation.

This class implements the discrete time (DT) realization of a first order derivative continuous time (CT) transfer function. In CT it is: mu_0*s G(s) = ----------— 1 + tau*s

Member Typedef Documentation

template<typename ValueType_ >
using robot_utils::FirstOrderDerivative< ValueType_ >::BaseType = ContinuousTimeTransferFunction<ValueType_, 1>

Constructor & Destructor Documentation

template<typename ValueType_ >
robot_utils::FirstOrderDerivative< ValueType_ >::FirstOrderDerivative ( )
inline
template<typename ValueType_ >
robot_utils::FirstOrderDerivative< ValueType_ >::FirstOrderDerivative ( const double  dt,
const double  continuousTimeConstant,
const double  gain,
const ValueType_ &  y0 = getDefaultValue<ValueType_>() 
)
inline
Parameters
dtSample time
continuousTimeConstantThe CT time constant tau (see class description)
gainThe CT transfer function gain mu_0 (see class description)
y0Default value to initialize the filter to
template<typename ValueType_ >
robot_utils::FirstOrderDerivative< ValueType_ >::~FirstOrderDerivative ( )
overridedefault

Member Function Documentation

template<typename ValueType_ >
const ValueType_& robot_utils::FirstOrderDerivative< ValueType_ >::getFilteredValue ( ) const
inline
Returns
Output of the filter (filtered value)
template<typename ValueType_ >
void robot_utils::FirstOrderDerivative< ValueType_ >::setContinuousTimeConstant ( const double  continuousTimeConstant,
const ValueType_ &  y0 = getDefaultValue<ValueType_>() 
)
inline

Set filter continuous time constant and reset the filter

Parameters
continuousTimeConstantThe CT time constant tau (see class description)
y0Default value to initialize the filter to
template<typename ValueType_ >
void robot_utils::FirstOrderDerivative< ValueType_ >::setFilterParameters ( const double  dt,
const double  continuousTimeConstant,
const double  gain,
const ValueType_ &  y0 = getDefaultValue<ValueType_>() 
)
inline

Set filter parameters and reset the filter

Parameters
dtSample time
continuousTimeConstantThe CT time constant tau (see class description)
gainThe CT transfer function gain mu_0 (see class description)
y0Default value to initialize the filter to
template<typename ValueType_ >
void robot_utils::FirstOrderDerivative< ValueType_ >::setGain ( const double  gain,
const ValueType_ &  y0 = getDefaultValue<ValueType_>() 
)
inline

Set filter gain and reset the filter

Parameters
gainThe CT transfer function gain mu_0 (see class description)
y0Default value to initialize the filter to
template<typename ValueType_ >
void robot_utils::FirstOrderDerivative< ValueType_ >::setSamplingTime ( const double  dt,
const ValueType_ &  y0 = getDefaultValue<ValueType_>() 
)
inline

Set the sampling time and reset the filter

Parameters
dtSampling time
y0Default value to initialize the filter to

Member Data Documentation

template<typename ValueType_ >
double robot_utils::FirstOrderDerivative< ValueType_ >::dt_
protected

Sample time.

template<typename ValueType_ >
double robot_utils::FirstOrderDerivative< ValueType_ >::mu0_
protected

The steady state gain of the CT system.

template<typename ValueType_ >
double robot_utils::FirstOrderDerivative< ValueType_ >::tau_
protected

The time constant tau of the CT system.


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