g2opy icon indicating copy to clipboard operation
g2opy copied to clipboard

Fixes Eigen quaternion member access

Open brgrp opened this issue 3 years ago • 2 comments

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

brgrp avatar Apr 16 '21 08:04 brgrp

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

Ali007788 avatar Nov 09 '21 19:11 Ali007788

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

miquelmassot avatar Dec 06 '21 13:12 miquelmassot