forked from Archive/PX4-Autopilot
FlightTaskAuto: check yawspeed saturation before constraining
to avoid possible numerical float equality issues.
This commit is contained in:
parent
12449c23c5
commit
1efc8c27eb
|
@ -117,10 +117,10 @@ void FlightTaskAuto::_limitYawRate()
|
|||
}
|
||||
|
||||
if (PX4_ISFINITE(_yawspeed_setpoint)) {
|
||||
_yawspeed_setpoint = math::constrain(_yawspeed_setpoint, -yawrate_max, yawrate_max);
|
||||
|
||||
// The yaw setpoint is aligned when its rate is not saturated
|
||||
_yaw_sp_aligned = _yaw_sp_aligned && (fabsf(_yawspeed_setpoint) < yawrate_max);
|
||||
|
||||
_yawspeed_setpoint = math::constrain(_yawspeed_setpoint, -yawrate_max, yawrate_max);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue