mirror of https://github.com/ArduPilot/ardupilot
Filter: NotchFilter: return NaN for `logging_frequency` if not initialised
This commit is contained in:
parent
1a39bd1a6e
commit
0a3bdbfdc9
|
@ -19,6 +19,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "NotchFilter.h"
|
#include "NotchFilter.h"
|
||||||
|
#include <AP_Logger/AP_Logger.h>
|
||||||
|
|
||||||
const static float NOTCH_MAX_SLEW = 0.05f;
|
const static float NOTCH_MAX_SLEW = 0.05f;
|
||||||
const static float NOTCH_MAX_SLEW_LOWER = 1.0f - NOTCH_MAX_SLEW;
|
const static float NOTCH_MAX_SLEW_LOWER = 1.0f - NOTCH_MAX_SLEW;
|
||||||
|
@ -135,6 +136,15 @@ void NotchFilter<T>::reset()
|
||||||
need_reset = true;
|
need_reset = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAL_LOGGING_ENABLED
|
||||||
|
// return the frequency to log for the notch
|
||||||
|
template <class T>
|
||||||
|
float NotchFilter<T>::logging_frequency() const
|
||||||
|
{
|
||||||
|
return initialised ? _center_freq_hz : AP::logger().quiet_nanf();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
instantiate template classes
|
instantiate template classes
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,9 +49,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the frequency to log for the notch
|
// return the frequency to log for the notch
|
||||||
float logging_frequency(void) const {
|
float logging_frequency(void) const;
|
||||||
return initialised?_center_freq_hz:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue