Closed ajinkyabedekar closed 4 years ago
are you compiling against Eigen 3.3.X
?
in Eigen 3.3.5
and above, the Eigen::Quaternion
modified their interface after the update, eigen changed the return type of the function:
Eigen::Quaternion<float> q = {1,0,0,0}; // w x y z
cout << q.w() << endl;
in Quaternion.h
(Eigen 3.3.7
):
EIGEN_DEVICE_FUNC inline NonConstCoeffReturnType w() { return this->derived().coeffs().w(); }
in Quaternion.h
(Eigen 3.3.4
)
EIGEN_DEVICE_FUNC inline Scalar& w() { return this->derived().coeffs().coeffRef(3); }
the return type is a Scalar
type before.
Now define of NonConstCoeffReturnType
is as following:
typedef typename internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit),
Scalar&, CoeffReturnType>::type NonConstCoeffReturnType;
This is a type cast issue, what we can do is to convert the NonConstCoeffReturnType
to Scalar&
, unlucky I don't know how to do that yet, if anyone is familiar with this, please post your solution.
This workaround fixed my problem, please check this one if you are facing this issue.
https://github.com/pybind/pybind11/issues/2058#issuecomment-693329238
Change g2opy/python/core/eigen_types.h, Line 185-187 with following.
Return type of Eigen::Quaterniond::x() const is const double &, and return type of Eigen::Quaterniond::x() is double &. So you can change the return type of these functions like this:
.def("x", (const double &(Eigen::Quaterniond::*)() const) & Eigen::Quaterniond::x)
.def("y", (const double &(Eigen::Quaterniond::*)() const) & Eigen::Quaterniond::y)
.def("z", (const double &(Eigen::Quaterniond::*)() const) & Eigen::Quaterniond::z)
.def("w", (const double &(Eigen::Quaterniond::*)() const) & Eigen::Quaterniond::w)
While using cmake .. command, the output received is as follows:
While running make -j8 command, I am getting the following error:
Can someone please help?