Closed narutojxl closed 4 years ago
Hi @narutojxl, Thanks for your question. The conversion is all in Hamilton as Eigen's.
In joan's paper, his rotation is also Hamilton. In math_utils.h
template
inline Eigen::Matrix<typename Derived::Scalar, 4, 4> LeftQuatMatrix(const Eigen::QuaternionBase &q) { Eigen::Matrix<typename Derived::Scalar, 4, 4> m; Eigen::Matrix<typename Derived::Scalar, 3, 1> vq = q.vec(); typename Derived::Scalar q4 = q.w(); m.block(0, 0, 3, 3) << q4 * I3x3 + SkewSymmetric(vq); m.block(3, 0, 1, 3) << -vq.transpose(); m.block(0, 3, 3, 1) << vq; m(3, 3) = q4; return m; } The code doesn't consistent with above definition?
I think it is exactly the same, except the order of the quaternion, right?
q_L in code is:
joan q_L is:
I don't understand why they are the same, right? :)
Since the orders of the coefficients are different. If you swap q_v
and q_w
, these two matrices are the same, right???
Hi @hyye, thanks for your patience with me :), thanks a lot !
vec()
function. It returns the imaginary part(q_x, q_y, q_z), matching joan's quaternion definition(q_w is scalar part, [q_x, q_y, q_z] is imaginary part). x(), y(), z()
return the x, y, z coefficient respectively of quaternion. w()
return the w coefficient.
Hi @hyye thanks for your excellent work :)
Thanks for your help!