mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 12:57:35 +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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user