mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 04:54:07 +08:00
BlockLowPass: initialize state in definition
This commit is contained in:
parent
82d32c7f3f
commit
4ce4fe05c5
@ -66,7 +66,6 @@ public:
|
||||
// methods
|
||||
BlockLowPass(SuperBlock *parent, const char *name) :
|
||||
Block(parent, name),
|
||||
_state(NAN /* initialize to invalid val, force into is_finite() check on first call */),
|
||||
_fCut(this, "") // only one parameter, no need to name
|
||||
{}
|
||||
virtual ~BlockLowPass() = default;
|
||||
@ -77,7 +76,7 @@ public:
|
||||
void setState(float state) { _state = state; }
|
||||
protected:
|
||||
// attributes
|
||||
float _state;
|
||||
float _state{NAN}; // initialize to invalid val, force into is_finite() check on first call
|
||||
control::BlockParamFloat _fCut;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user