mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
LowPassFilter2p: fix _cutoff_freq <= 0 (disabled filter)
If the filter was disabled, the apply() would always return 0.
This commit is contained in:
parent
d2e2b5e8ce
commit
294af5daad
@ -50,7 +50,7 @@ void LowPassFilter2p::set_cutoff_frequency(float sample_freq, float cutoff_freq)
|
||||
|
||||
if (_cutoff_freq <= 0.0f) {
|
||||
// no filtering
|
||||
_b0 = 0.0f;
|
||||
_b0 = 1.0f;
|
||||
_b1 = 0.0f;
|
||||
_b2 = 0.0f;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ void LowPassFilter2pVector3f::set_cutoff_frequency(float sample_freq, float cuto
|
||||
|
||||
if (_cutoff_freq <= 0.0f) {
|
||||
// no filtering
|
||||
_b0 = 0.0f;
|
||||
_b0 = 1.0f;
|
||||
_b1 = 0.0f;
|
||||
_b2 = 0.0f;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user