manual_control: handle NAN

This commit is contained in:
Julian Oes 2021-06-10 11:55:48 +02:00 committed by Matthias Grob
parent 374c9f38a7
commit efd8757fda

View File

@ -59,6 +59,11 @@ class MovingDiff
public:
void update(float value, float dt_s)
{
if (!PX4_ISFINITE(value)) {
// Ignore NAN
return;
}
math::constrain(dt_s, 0.f, _time_period_s);
// Leave _diff at 0.0f if we don't have a _last_value yet.