Registered Member
|
Hi all
I am using ROS and trying to migrate a set of packages from http://www.thearmrobot.com/trac/wiki/ARMSimulatorInstallation which are built for Eigen2, to Eigen3. I have referenced the Eigen wiki page on the subject, and have successfully migrated all packages except one. The compile errors I get are below. Any help is appreciated.
|
Registered Member
|
You are trying to instantiate the type Eigen::Matrix<double,7,1,1,7,1> or possibly Eigen::Matrix<double,7,1,1> as the 5th and 6th template parameter have their default value. The error message is trying to tell you that this is not a valid type in Eigen3.
The problem is the 4th template parameter. For matrices, it specifies amongst other whether the matrix is stored in column-major order (if 4th parameter = ColMajor = 0) or row-major order (if 4th parameter = RowMajor = 1). However, for vectors row-major and column-major are the same, so to prevent type proliferation we introduced the requirement that row vectors have RowMajor and column vectors have ColMajor. Your type Eigen::Matrix<double,7,1,1> is a column-vector, so it should have ColMajor, so the 4th parameter should be 0. This requirement is new in Eigen3. If you want all your matrices to be row-major, then the usual method is to #define EIGEN_DEFAULT_TO_ROW_MAJOR before you #include any Eigen files. However, this may not be the best thing for you. Looking at the source at http://www.thearmrobot.com/trac/browser ... h/matrix.h , an alternative may be to change "Eigen::Matrix<double, R,C, Eigen::RowMajorBit>" to "Eigen::Matrix<double, R,C, (C==1 && R>1) ? Eigen::ColMajor : Eigen::RowMajor>" in lines 43 and 45. There is some more information about storage orders in http://eigen.tuxfamily.org/dox-devel/To ... rders.html but that page does not mention the requirement about vectors. |
Registered Member
|
Outstanding! Thanks for the information, and the explanation/suggestion to go with it.
It compiles fine, and I have yet to see any runtime issues. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]