Skip to content
Snippets Groups Projects
Commit fa6666e3 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add q2R for vector q

parent 77815423
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,19 @@ inline Eigen::Matrix<typename Derived::Scalar, 3, 3> q2R(const Eigen::Quaternion
return _q.matrix();
}
/** \brief quaternion to rotation matrix conversion
*
* @param _q a right-handed unit quaternion
* @return the equivalent rotation matrix
*/
template<typename Derived>
inline Eigen::Matrix<typename Derived::Scalar, 3, 3> q2R(const Eigen::MatrixBase<Derived>& _q)
{
MatrixSizeCheck<4,1>::check(_q);
Eigen::Quaternion<typename Derived::Scalar> q(_q(3),_q(0),_q(1),_q(2));
return q2R( q );
}
/** \brief rotation matrix to quaternion conversion
*
* @param _R a rotation matrix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment