Browse Source

AP_ICEngine: fixed RPM filter rate and plane.G_Dt

AP_ICEngine runs at 10Hz, so we need to use 10 for the filter.

As this runs in a constructor it also caused memoisation of the wrong
AP_Scheduler _loop_period_s which resulted in plane.G_Dt always being
1/50, which is a much more serious issue

this is a temporary fix, we need a better one soon
apm_2208
Andrew Tridgell 3 years ago
parent
commit
0731b5cfa0
  1. 3
      libraries/AP_ICEngine/AP_ICEngine.cpp

3
libraries/AP_ICEngine/AP_ICEngine.cpp

@ -168,7 +168,8 @@ AP_ICEngine::AP_ICEngine(const AP_RPM &_rpm) : @@ -168,7 +168,8 @@ AP_ICEngine::AP_ICEngine(const AP_RPM &_rpm) :
}
_singleton = this;
_rpm_filter.set_cutoff_frequency(1 / AP::scheduler().get_loop_period_s(), 0.5f);
// ICEngine runs at 10Hz
_rpm_filter.set_cutoff_frequency(10, 0.5f);
}
/*

Loading…
Cancel
Save