mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ControlMath: don't consider sign when vector length is 0
This commit is contained in:
parent
bd37c274c6
commit
ec79b2f8c8
@ -154,7 +154,7 @@ void constrainPIDu(matrix::Vector3f &u, bool stop_I[2], const float Ulimits[2],
|
||||
* since we do not know better. (no direction given)
|
||||
*/
|
||||
if (u.length() < 0.0001f) {
|
||||
u = matrix::Vector3f(0.0f, 0.0f, math::sign(u(2)) * Ulimits[1]);
|
||||
u = matrix::Vector3f(0.0f, 0.0f, -Ulimits[1]);
|
||||
|
||||
} else {
|
||||
u = u.normalized() * Ulimits[1];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user