25 #ifndef INCLUDED_ExternalQuaternion_h_GUID_3235DD66_A6E6_47BD_7CC0_51BBF45EF38D 26 #define INCLUDED_ExternalQuaternion_h_GUID_3235DD66_A6E6_47BD_7CC0_51BBF45EF38D 35 #include <type_traits> 40 namespace external_quat {
46 return util::quat_exp(incRotVec / 2.);
52 assert(vecToQuatScalarPartSquared(incRotVec) >= 0 &&
53 "Incremental rotation vector's squared norm was greater " 54 "than 1! Precondition fail!");
58 ret.topLeftCorner<3, 3>() =
61 incRotVec.transpose() /
62 (-4. * std::sqrt(vecToQuatScalarPartSquared(incRotVec)));
68 double a = w.squaredNorm() / 48 + 0.5;
70 Eigen::Matrix3d topBlock =
71 (w * w.transpose()) / 24. + Eigen::Matrix3d::Identity() * a;
73 Eigen::RowVector3d bottomRow =
74 (Eigen::Vector3d(2 * a, 0, 0) + (w[0] * w) / 12 - w / 4)
77 ret << topBlock, bottomRow;
85 #endif // INCLUDED_ExternalQuaternion_h_GUID_3235DD66_A6E6_47BD_7CC0_51BBF45EF38D The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Eigen::Quaterniond vecToQuat(types::Vector< 3 > const &incRotVec)
For use in maintaining an "external quaternion" and 3 incremental orientations, as done by Welch base...
Definition: ExternalQuaternion.h:45
Definition: Quaternion.h:47
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127