mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
AxisAngle: call q.imag().norm() for conversion
This is important depending on the platform because norm() calls matrix::squrt() which dispatches correctly to the implementation for the used type. Otherwise float squrt()s can get calculated as double.
This commit is contained in:
parent
4873dc1c1e
commit
2cca35c8fe
@ -69,7 +69,7 @@ public:
|
||||
AxisAngle(const Quaternion<Type> &q)
|
||||
{
|
||||
AxisAngle &v = *this;
|
||||
Type mag = Type(sqrt(q(1) * q(1) + q(2) * q(2) + q(3) * q(3)));
|
||||
Type mag = q.imag().norm();
|
||||
if (fabs(mag) >= Type(1e-10)) {
|
||||
v = q.imag() * Type(Type(2) * atan2(mag, q(0)) / mag);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user