mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-12 07:17:36 +08:00
manual_control: handle NAN
This commit is contained in:
committed by
Matthias Grob
parent
374c9f38a7
commit
efd8757fda
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user