mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 01:10:34 +08:00
PositionControl: set vel_dot to 0 if NAN
This commit is contained in:
committed by
Lorenz Meier
parent
33d0a4e8ed
commit
5ffcb6af01
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user