mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
manual_control: handle NAN
This commit is contained in:
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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user