uoip / g2opy

Python binding of SLAM graph optimization framework g2o
668 stars 176 forks source link

Fixes Eigen quaternion member access #52

Open brgrp opened 3 years ago

brgrp commented 3 years ago

Ubuntu 20.04 - Eigen 3.3.7

I encountered the same problem on Ubuntu 20.04. In my case, I could build the library by changing:

        .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)

in g2opy/python/core/eigen_types.h to:

        .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(); })

Originally posted by @koide3 in https://github.com/uoip/g2opy/issues/46#issuecomment-704190419

Ali007788 commented 2 years ago

Hello @codegrafix,

I just tried your solution to build the library on Ubuntu 20.04 - Eigen 3.3.7. I got the steps till 99%, but it still doesn't work! Do you have any idea how to solve it?

thanks

miquelmassot commented 2 years ago

This solution works on Ubuntu 20.04 in WSL2 with stock Eigen 3.3.7