mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
AP_InertialSensor: count filters to match notch options
this allows for much more complex filter setups as long as not filtering on all IMUs
This commit is contained in:
parent
d07761cfd9
commit
d653499efc
@ -930,9 +930,10 @@ AP_InertialSensor::init(uint16_t loop_rate)
|
||||
// calculate number of notches we might want to use for harmonic notch
|
||||
if (notch.params.enabled() || fft_enabled) {
|
||||
const bool double_notch = notch.params.hasOption(HarmonicNotchFilterParams::Options::DoubleNotch);
|
||||
const bool all_sensors = notch.params.hasOption(HarmonicNotchFilterParams::Options::EnableOnAllIMUs);
|
||||
num_filters += __builtin_popcount(notch.params.harmonics())
|
||||
* notch.num_dynamic_notches * (double_notch ? 2 : 1)
|
||||
* sensors_used;
|
||||
* (all_sensors?sensors_used:1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user