lgmath icon indicating copy to clipboard operation
lgmath copied to clipboard

Problem with Transformation constructor

Open pomerlef opened this issue 8 years ago • 1 comments

Not sure if it's wanted, but:

lgmath::se3::Transformation test2(Eigen::Matrix4d::Identity());

won't compile and yield:

home/frank/research/code/lgmath/tests/TransformTests.cpp:59:66: error: call of overloaded ‘Transformation(const IdentityReturnType)’ is ambiguous
     lgmath::se3::Transformation test2(Eigen::Matrix4d::Identity());
                                                                  ^
/home/frank/research/code/lgmath/tests/TransformTests.cpp:59:66: note: candidates are:
In file included from /home/frank/research/code/lgmath/tests/TransformTests.cpp:20:0:
/home/frank/research/code/lgmath/include/lgmath/se3/Transformation.hpp:73:12: note: lgmath::se3::Transformation::Transformation(const VectorXd&)
   explicit Transformation(const Eigen::VectorXd& xi_ab);
            ^
/home/frank/research/code/lgmath/include/lgmath/se3/Transformation.hpp:67:3: note: lgmath::se3::Transformation::Transformation(const Eigen::Matrix<double, 6, 1>&, unsigned int)
   Transformation(const Eigen::Matrix<double,6,1>& xi_ab, unsigned int numTerms = 0);
   ^
/home/frank/research/code/lgmath/include/lgmath/se3/Transformation.hpp:57:12: note: lgmath::se3::Transformation::Transformation(const Matrix4d&)
   explicit Transformation(const Eigen::Matrix4d& T);

pomerlef avatar Aug 19 '16 15:08 pomerlef

A temporary workaround is to force the constructor using vector by doing:

lgmath::se3::Transformation test2(lgmath::se3::tran2vec(Eigen::Matrix4d::Identity()));

The function tran2vec transform the 4x4 to a 6x1, which seems to be better accepted by the constructor.

pomerlef avatar Aug 29 '16 22:08 pomerlef