mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 01:17:51 +08:00
BlockLowPass: initialize state in definition
This commit is contained in:
committed by
Daniel Agar
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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user