mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:23:33 +08:00
Ensure direction is always defined for axis angle.
This commit is contained in:
@@ -79,7 +79,7 @@ public:
|
|||||||
Type ang = (Type)2.0f*acosf(q(0));
|
Type ang = (Type)2.0f*acosf(q(0));
|
||||||
Type mag = sinf(ang/2.0f);
|
Type mag = sinf(ang/2.0f);
|
||||||
if (fabsf(ang) < 1e-10f) {
|
if (fabsf(ang) < 1e-10f) {
|
||||||
v(0) = 0;
|
v(0) = 1e-10f;
|
||||||
v(1) = 0;
|
v(1) = 0;
|
||||||
v(2) = 0;
|
v(2) = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user