Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
afdaniele committed Nov 19, 2020
1 parent 5587024 commit 8218fee
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions python/core/eigen_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,15 @@ void declareEigenTypes(py::module & m) {
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", (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)
// Replaced by the following: @Pietro Griffa - ETHZ - following this issue https://github.com/uoip/g2opy/issues/46#issuecomment-704190419
.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<const Eigen::Quaterniond::Coefficients,3> (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::vec)

Expand Down

0 comments on commit 8218fee

Please sign in to comment.