Skip to content

Commit

Permalink
atune: initialize filter if not already initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
bresch authored and dagar committed Nov 17, 2023
1 parent 62027b0 commit 2110eae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2110eae

Please sign in to comment.