forked from Archive/PX4-Autopilot
atune: initialize filter if not already initialized
This commit is contained in:
parent
c3ed50488f
commit
9ab8970206
|
@ -225,7 +225,7 @@ void FwAutotuneAttitudeControl::checkFilters()
|
|||
reset_filters = true;
|
||||
}
|
||||
|
||||
if (reset_filters) {
|
||||
if (reset_filters || !_are_filters_initialized) {
|
||||
_are_filters_initialized = true;
|
||||
_filter_sample_rate = update_rate_hz;
|
||||
_sys_id.setLpfCutoffFrequency(_filter_sample_rate, _param_imu_gyro_cutoff.get());
|
||||
|
|
|
@ -236,7 +236,7 @@ void McAutotuneAttitudeControl::checkFilters()
|
|||
reset_filters = true;
|
||||
}
|
||||
|
||||
if (reset_filters && !_are_filters_initialized) {
|
||||
if (reset_filters || !_are_filters_initialized) {
|
||||
_filter_dt = _sample_interval_avg;
|
||||
|
||||
const float filter_rate_hz = 1.f / _filter_dt;
|
||||
|
|
Loading…
Reference in New Issue