RpmControl: name current timestamp now following the convention

This commit is contained in:
Matthias Grob 2024-12-11 20:18:51 +01:00
parent ee67e4bb28
commit cd0e04f8b0

View File

@ -82,11 +82,11 @@ public:
}
}
hrt_abstime current_time = hrt_absolute_time();
const float dt = math::constrain((current_time - _timestamp_last_update) * 1e-6f, 1e-3f, 1.f);
_timestamp_last_update = current_time;
hrt_abstime now = hrt_absolute_time();
const float dt = math::constrain((now - _timestamp_last_update) * 1e-6f, 1e-3f, 1.f);
_timestamp_last_update = now;
const bool rpm_measurement_timeout = (current_time - _timestamp_last_rpm_measurement) < 1_s;
const bool rpm_measurement_timeout = (now - _timestamp_last_rpm_measurement) < 1_s;
const bool no_excessive_rpm = _rpm_estimate < RPM_MAX_VALUE;
if (rpm_measurement_timeout && no_excessive_rpm) {