mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_InertialSensor: make sure dynamic notches always get updates so that slew limiting is not too aggressive
This commit is contained in:
parent
6eff3922db
commit
5ce02708cf
@ -1615,6 +1615,7 @@ void AP_InertialSensor::HarmonicNotch::update_params(uint8_t instance, bool conv
|
||||
const float center_freq = calculated_notch_freq_hz[0];
|
||||
if (!is_equal(last_bandwidth_hz[instance], params.bandwidth_hz()) ||
|
||||
!is_equal(last_attenuation_dB[instance], params.attenuation_dB()) ||
|
||||
(params.tracking_mode() == HarmonicNotchDynamicMode::Fixed && !is_equal(last_center_freq_hz[instance], center_freq)) ||
|
||||
converging) {
|
||||
filter[instance].init(gyro_rate,
|
||||
center_freq,
|
||||
@ -1623,7 +1624,7 @@ void AP_InertialSensor::HarmonicNotch::update_params(uint8_t instance, bool conv
|
||||
last_center_freq_hz[instance] = center_freq;
|
||||
last_bandwidth_hz[instance] = params.bandwidth_hz();
|
||||
last_attenuation_dB[instance] = params.attenuation_dB();
|
||||
} else if (!is_equal(last_center_freq_hz[instance], center_freq)) {
|
||||
} else if (params.tracking_mode() != HarmonicNotchDynamicMode::Fixed) {
|
||||
if (num_calculated_notch_frequencies > 1) {
|
||||
filter[instance].update(num_calculated_notch_frequencies, calculated_notch_freq_hz);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user