mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
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…
x
Reference in New Issue
Block a user