34 #ifndef VP_EIGEN_CONVERSION_H
35 #define VP_EIGEN_CONVERSION_H
37 #include <visp3/core/vpConfig.h>
38 #ifdef VISP_HAVE_EIGEN3
39 #include <Eigen/Dense>
41 #include <visp3/core/vpMatrix.h>
45 #ifdef VISP_HAVE_EIGEN3
51 template <
typename Type>
54 dst.
buildFrom(src.x(), src.y(), src.z(), src.w());
57 template <
typename Type>
60 const unsigned int val_2 = 2;
61 dst.
buildFrom(src.angle() * src.axis()(0), src.angle() * src.axis()(1), src.angle() * src.axis()(val_2));
69 template <
typename Derived>
72 dst = Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(src.
data, src.
getRows(),
76 template <
typename Derived>
79 dst = Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(src.
data, src.
getRows(),
83 template <
typename Type>
86 dst.w() =
static_cast<Type
>(src.
w());
87 dst.x() =
static_cast<Type
>(src.
x());
88 dst.y() =
static_cast<Type
>(src.
y());
89 dst.z() =
static_cast<Type
>(src.
z());
92 template <
typename Type>
95 const unsigned int index_0 = 0;
96 const unsigned int index_1 = 1;
97 const unsigned int index_2 = 2;
98 dst.angle() =
static_cast<Type
>(src.
getTheta());
99 dst.axis()(index_0) =
static_cast<Type
>(src.
getU()[index_0]);
100 dst.axis()(index_1) =
static_cast<Type
>(src.
getU()[index_1]);
101 dst.axis()(index_2) =
static_cast<Type
>(src.
getU()[index_2]);
unsigned int getCols() const
Type * data
Address of the first element of the data array.
unsigned int getRows() const
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Implementation of a rotation vector as quaternion angle minimal representation.
const double & z() const
Returns the z-component of the quaternion.
vpQuaternionVector & buildFrom(const double &qx, const double &qy, const double &qz, const double &qw)
const double & x() const
Returns the x-component of the quaternion.
const double & y() const
Returns the y-component of the quaternion.
const double & w() const
Returns the w-component of the quaternion.
Implementation of row vector and the associated operations.
Implementation of a rotation vector as axis-angle minimal representation.
vpThetaUVector & buildFrom(const vpHomogeneousMatrix &M)
VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst)
void visp2eigen(const vpMatrix &src, Eigen::MatrixBase< Derived > &dst)