PX4 Firmware
PX4 Autopilot Software http://px4.io
control::BlockLowPass2 Class Reference

A 2nd order low pass filter block which uses the default px4 2nd order low pass filter. More...

#include <BlockLowPass2.hpp>

Inheritance diagram for control::BlockLowPass2:
Collaboration diagram for control::BlockLowPass2:

Public Member Functions

 BlockLowPass2 (SuperBlock *parent, const char *name, float sample_freq)
 
virtual ~BlockLowPass2 ()=default
 
float update (float input)
 
float getState ()
 
float getFCutParam ()
 
void setState (float state)
 
- Public Member Functions inherited from control::Block
 Block (SuperBlock *parent, const char *name)
 
virtual ~Block ()=default
 
 Block (const Block &)=delete
 
Blockoperator= (const Block &)=delete
 
 Block (Block &&)=delete
 
Blockoperator= (Block &&)=delete
 
void getName (char *name, size_t n)
 
virtual void updateParams ()
 
virtual void setDt (float dt)
 
float getDt ()
 
- Public Member Functions inherited from ListNode< Block *>
void setSibling (Block * sibling)
 
const Block * getSibling () const
 

Protected Attributes

float _state
 
control::BlockParamFloat _fCut
 
float _fs
 
math::LowPassFilter2p _lp
 
- Protected Attributes inherited from control::Block
const char * _name
 
SuperBlock_parent
 
float _dt {0.0f}
 
List< BlockParamBase * > _params
 
- Protected Attributes inherited from ListNode< Block *>
Block * _list_node_sibling
 

Additional Inherited Members

- Protected Member Functions inherited from control::Block
virtual void updateParamsSubclass ()
 
SuperBlockgetParent ()
 
List< BlockParamBase * > & getParams ()
 

Detailed Description

A 2nd order low pass filter block which uses the default px4 2nd order low pass filter.

Definition at line 61 of file BlockLowPass2.hpp.

Constructor & Destructor Documentation

◆ BlockLowPass2()

control::BlockLowPass2::BlockLowPass2 ( SuperBlock parent,
const char *  name,
float  sample_freq 
)
inline

Definition at line 65 of file BlockLowPass2.hpp.

◆ ~BlockLowPass2()

virtual control::BlockLowPass2::~BlockLowPass2 ( )
virtualdefault

Member Function Documentation

◆ getFCutParam()

float control::BlockLowPass2::getFCutParam ( )
inline

Definition at line 76 of file BlockLowPass2.hpp.

Referenced by control::blockLowPass2Test(), blockLowPass2Test(), and update().

Here is the caller graph for this function:

◆ getState()

float control::BlockLowPass2::getState ( )
inline

Definition at line 75 of file BlockLowPass2.hpp.

Referenced by control::blockLowPass2Test(), blockLowPass2Test(), and update().

Here is the caller graph for this function:

◆ setState()

void control::BlockLowPass2::setState ( float  state)
inline

Definition at line 77 of file BlockLowPass2.hpp.

Referenced by control::blockLowPass2Test(), blockLowPass2Test(), and update().

Here is the caller graph for this function:

◆ update()

float control::BlockLowPass2::update ( float  input)

Definition at line 48 of file BlockLowPass2.cpp.

References _fs, _lp, _state, math::LowPassFilter2p::apply(), FLT_EPSILON, math::LowPassFilter2p::get_cutoff_freq(), getFCutParam(), getState(), math::LowPassFilter2p::set_cutoff_frequency(), and setState().

Referenced by control::blockLowPass2Test(), and blockLowPass2Test().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _fCut

control::BlockParamFloat control::BlockLowPass2::_fCut
protected

Definition at line 81 of file BlockLowPass2.hpp.

◆ _fs

float control::BlockLowPass2::_fs
protected

Definition at line 82 of file BlockLowPass2.hpp.

Referenced by update().

◆ _lp

math::LowPassFilter2p control::BlockLowPass2::_lp
protected

Definition at line 83 of file BlockLowPass2.hpp.

Referenced by update().

◆ _state

float control::BlockLowPass2::_state
protected

Definition at line 80 of file BlockLowPass2.hpp.

Referenced by update().


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