36 #ifndef _vpEigenConversion_h_ 37 #define _vpEigenConversion_h_ 39 #include <visp3/core/vpConfig.h> 40 #ifdef VISP_HAVE_EIGEN3 41 #include <Eigen/Dense> 43 #include <visp3/core/vpMatrix.h> 46 #ifdef VISP_HAVE_EIGEN3 52 template<
typename Type>
55 dst.
buildFrom(src.x(), src.y(), src.z(), src.w());
58 template<
typename Type>
61 dst.
buildFrom(src.angle() * src.axis()(0), src.angle() * src.axis()(1), src.angle() * src.axis()(2));
69 template<
typename Derived>
72 dst = Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(src.
data, src.
getRows(), src.
getCols());
75 template<
typename Derived>
78 dst = Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(src.
data, src.
getRows(), src.
getCols());
81 template<
typename Type>
84 dst.w() =
static_cast<Type
>(src.
w());
85 dst.x() =
static_cast<Type
>(src.
x());
86 dst.y() =
static_cast<Type
>(src.
y());
87 dst.z() =
static_cast<Type
>(src.
z());
90 template<
typename Type>
93 dst.angle() =
static_cast<Type
>(src.
getTheta());
94 dst.axis()(0) = static_cast<Type>(src.
getU()[0]);
95 dst.axis()(1) = static_cast<Type>(src.
getU()[1]);
96 dst.axis()(2) = static_cast<Type>(src.
getU()[2]);
Implementation of a matrix and operations on matrices.
VISP_EXPORT void eigen2visp(const Eigen::MatrixXd &src, vpMatrix &dst)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
double y() const
Returns y-component of the quaternion.
Type * data
Address of the first element of the data array.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
unsigned int getCols() const
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
double w() const
Returns w-component of the quaternion.
double z() const
Returns z-component of the quaternion.
double x() const
Returns x-component of the quaternion.
Implementation of a rotation vector as quaternion angle minimal representation.
unsigned int getRows() const
void visp2eigen(const vpMatrix &src, Eigen::MatrixBase< Derived > &dst)
Implementation of column vector and the associated operations.
Implementation of a rotation vector as axis-angle minimal representation.