Skip to content
Snippets Groups Projects
Commit 5ffcb6af authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Lorenz Meier
Browse files

PositionControl: set vel_dot to 0 if NAN

parent 33d0a4e8
No related branches found
No related tags found
No related merge requests found
......@@ -173,6 +173,15 @@ void PositionControl::_interfaceMapping()
}
}
// ensure that vel_dot is finite, otherwise set to 0
if (!PX4_ISFINITE(_vel_dot(0)) || !PX4_ISFINITE(_vel_dot(1))) {
_vel_dot(0) = _vel_dot(1) = 0.0f;
}
if (!PX4_ISFINITE(_vel_dot(2))) {
_vel_dot(2) = 0.0f;
}
if (!PX4_ISFINITE(_yawspeed_sp)) {
// Set the yawspeed to 0 since not used.
_yawspeed_sp = 0.0f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment