5#ifndef __pinocchio_math_rotation_hpp__
6#define __pinocchio_math_rotation_hpp__
8#include "pinocchio/fwd.hpp"
9#include "pinocchio/math/matrix.hpp"
10#include "pinocchio/math/sincos.hpp"
13#include <Eigen/Geometry>
25 template<
typename Vector3,
typename Scalar,
typename Matrix3>
27 const Eigen::MatrixBase<Vector3> & axis,
30 const Eigen::MatrixBase<Matrix3> & res)
37 Matrix3 &
res_ = PINOCCHIO_EIGEN_CONST_CAST(Matrix3, res);
63 template<
typename Vector3,
typename Scalar,
typename Matrix3>
65 const Eigen::MatrixBase<Vector3> & axis,
67 const Eigen::MatrixBase<Matrix3> & res)
79 template<
typename Matrix3>
83 Matrix3 &
rot_ = PINOCCHIO_EIGEN_CONST_CAST(Matrix3, rot);
85 typedef typename Matrix3::Scalar Scalar;
88 Options = PINOCCHIO_EIGEN_PLAIN_TYPE(Matrix3)::Options
90 typedef Eigen::Quaternion<Scalar, Options> Quaternion;
103 template<
typename Matrix3>
104 typename PINOCCHIO_EIGEN_PLAIN_TYPE(Matrix3)
108 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Matrix3) ReturnType;
110 typedef Eigen::JacobiSVD<Matrix3>
SVD;
111 const SVD svd(
mat, Eigen::ComputeFullU | Eigen::ComputeFullV);
116 res.col(2).noalias() = res.col(0).cross(res.col(1));
Main pinocchio namespace.
void toRotationMatrix(const Eigen::MatrixBase< Vector3 > &axis, const Scalar &cos_value, const Scalar &sin_value, const Eigen::MatrixBase< Matrix3 > &res)
Computes a rotation matrix from a vector and values of sin and cos orientations values.
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
void SINCOS(const S1 &a, S2 *sa, S3 *ca)
Computes sin/cos values of a given input scalar.
void normalizeRotation(const Eigen::MatrixBase< Matrix3 > &rot)
Orthogonormalization procedure for a rotation matrix (closed enough to SO(3)).
Matrix3 orthogonalProjection(const Eigen::MatrixBase< Matrix3 > &mat)
Orthogonal projection of a matrix on the SO(3) manifold.
bool isUnitary(const Eigen::MatrixBase< MatrixLike > &mat, const typename MatrixLike::RealScalar &prec=Eigen::NumTraits< typename MatrixLike::Scalar >::dummy_precision())
Check whether the input matrix is Unitary within the given precision.