mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 12:48:53 +08:00
RPMCapture: fix dt should not have a minimum which would limit to 6000rpm
This commit is contained in:
@@ -136,7 +136,7 @@ void RPMCapture::Run()
|
|||||||
|
|
||||||
if (rpm_raw < RPM_MAX_VALUE) {
|
if (rpm_raw < RPM_MAX_VALUE) {
|
||||||
// Don't update RPM filter with outliers
|
// Don't update RPM filter with outliers
|
||||||
const float dt = math::constrain((now - _timestamp_last_update) * 1e-6f, 0.01f, 1.f);
|
const float dt = math::min((now - _timestamp_last_update) * 1e-6f, 1.f);
|
||||||
_timestamp_last_update = now;
|
_timestamp_last_update = now;
|
||||||
_rpm_filter.setParameters(dt, 0.5f);
|
_rpm_filter.setParameters(dt, 0.5f);
|
||||||
_rpm_filter.update(_rpm_median_filter.apply(rpm_raw));
|
_rpm_filter.update(_rpm_median_filter.apply(rpm_raw));
|
||||||
|
|||||||
Reference in New Issue
Block a user