mirror of https://github.com/ArduPilot/ardupilot
AP_InertialSensor: don't update disabled notches
This commit is contained in:
parent
a15259d7e5
commit
5bdac5174c
|
@ -877,6 +877,9 @@ AP_InertialSensor::init(uint16_t loop_rate)
|
||||||
// dynamically, the calculated value is always some multiple of the configured center frequency, so start with the
|
// dynamically, the calculated value is always some multiple of the configured center frequency, so start with the
|
||||||
// configured value
|
// configured value
|
||||||
for (auto ¬ch : harmonic_notches) {
|
for (auto ¬ch : harmonic_notches) {
|
||||||
|
if (!notch.params.enabled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
notch.calculated_notch_freq_hz[0] = notch.params.center_freq_hz();
|
notch.calculated_notch_freq_hz[0] = notch.params.center_freq_hz();
|
||||||
notch.num_calculated_notch_frequencies = 1;
|
notch.num_calculated_notch_frequencies = 1;
|
||||||
notch.num_dynamic_notches = 1;
|
notch.num_dynamic_notches = 1;
|
||||||
|
@ -1635,9 +1638,11 @@ void AP_InertialSensor::update(void)
|
||||||
const bool converging = AP_HAL::millis() < HAL_INS_CONVERGANCE_MS;
|
const bool converging = AP_HAL::millis() < HAL_INS_CONVERGANCE_MS;
|
||||||
const float gyro_rate = _gyro_raw_sample_rates[i];
|
const float gyro_rate = _gyro_raw_sample_rates[i];
|
||||||
for (auto ¬ch : harmonic_notches) {
|
for (auto ¬ch : harmonic_notches) {
|
||||||
|
if (notch.params.enabled()) {
|
||||||
notch.update_params(i, converging, gyro_rate);
|
notch.update_params(i, converging, gyro_rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_startup_error_counts_set) {
|
if (!_startup_error_counts_set) {
|
||||||
for (uint8_t i=0; i<INS_MAX_INSTANCES; i++) {
|
for (uint8_t i=0; i<INS_MAX_INSTANCES; i++) {
|
||||||
|
|
Loading…
Reference in New Issue