mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 04:30:34 +08:00
atune: initialize filter if not already initialized
This commit is contained in:
@@ -229,7 +229,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;
|
||||
|
||||
Reference in New Issue
Block a user