From 2d67e1220003c1ef31df1dae0d8c445482617aad Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 16 Apr 2021 10:25:27 +0200 Subject: [PATCH] Fixes Eigen quaternion member access Ubuntu 20.04 - Eigen 3.3.7 --- python/core/eigen_types.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/core/eigen_types.h b/python/core/eigen_types.h index b58d529..4e8525c 100644 --- a/python/core/eigen_types.h +++ b/python/core/eigen_types.h @@ -181,11 +181,10 @@ void declareEigenTypes(py::module & m) { .def_static("from_two_vectors", [](Eigen::Matrix& a, Eigen::Matrix& b) { return Eigen::Quaterniond::FromTwoVectors(a, b); }) - - .def("x", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::x) - .def("y", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::y) - .def("z", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::z) - .def("w", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::w) + .def("x", [](const Eigen::Quaterniond& q) { return q.x(); }) + .def("y", [](const Eigen::Quaterniond& q) { return q.y(); }) + .def("z", [](const Eigen::Quaterniond& q) { return q.z(); }) + .def("w", [](const Eigen::Quaterniond& q) { return q.w(); }) .def("vec", (const Eigen::VectorBlock (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::vec) @@ -292,4 +291,4 @@ void declareEigenTypes(py::module & m) { } -} // end namespace g2o \ No newline at end of file +} // end namespace g2o