manual_control: use constrain() instead

This commit is contained in:
Julian Oes
2021-06-10 11:53:42 +02:00
committed by Matthias Grob
parent 2a41ade223
commit 374c9f38a7
+1 -6
View File
@@ -59,12 +59,7 @@ class MovingDiff
public:
void update(float value, float dt_s)
{
if (dt_s < 0.0f) {
dt_s = 0.0f;
} else if (dt_s > _time_period_s) {
dt_s = _time_period_s;
}
math::constrain(dt_s, 0.f, _time_period_s);
// Leave _diff at 0.0f if we don't have a _last_value yet.
if (PX4_ISFINITE(_last_value)) {