[eigen] Quaternion initialization from Block/segment (Eigen 3 beta 1)

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi from a long time lurker, one-time poster 

I'm trying to use eigen to efficiently work with a quaternion stored inside an Eigen::VectorXd (a state vector in an EKF-based SLAM)

I have attempted to do the following:

Eigen::VectorXd myvector;
Eigen::Quaternion q(myvector.segment(3,4));

I'm not sure whether this method avoids the copy?

This doesn't work however, and gives the following error:
/some/path/SLAM/src/Eigen/src/Geometry/Quaternion.h:443:0 
/some/path/SLAM/src/Eigen/src/Geometry/Quaternion.h:443: error: incomplete type 'Eigen::ei_quaternionbase_assign_impl<Eigen::Block<Eigen::Matrix<double, -0x00000000000000001, 1, 0, -0x00000000000000001, 1>, -0x00000000000000001, 1, true>, -0x00000000000000001, 1>' used in nested name specifier

To me, this makes me think that Quaternion doesn't understand Eigen::Block. Is this the case or am I doing something wrong?

I can "work-around" it by doing 
Eigen::Quaternion q(Eigen::Vector4d(myvector.segment(3,4))); 
but this seems sort of unclean (And presumably requires more copying?)

Thanks,
-Jens




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/