Skip to content

Commit

Permalink
Add the possibility to construct a SE3 from two vectors in python bin…
Browse files Browse the repository at this point in the history
…dings
  • Loading branch information
GiulioRomualdi committed Mar 16, 2021
1 parent 2bce485 commit a802537
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/bindings_se3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ void wrap_SE3(py::module &m)

SE3.def(py::init<const Scalar, const Scalar, const Scalar,
const Scalar, const Scalar, const Scalar>());
// SE3.def(py::init<const Translation&, const Quaternion&>());
SE3.def(py::init([](const SE3d::Translation& pos, const Eigen::Vector4d& quat) {
if(abs(quat.norm() - Scalar(1)) >= manif::Constants<Scalar>::eps_s) {
throw pybind11::value_error("The quaternion is not normalized!");
}
return manif::SE3d(pos, quat);
}),
py::arg("position"),
py::arg("quaternion"));

// SE3.def(py::init<const Translation&, const Eigen::AngleAxis<Scalar>&>());
// SE3.def(py::init<const Translation&, const manif::SO3<Scalar>&>());
// SE3.def(py::init<igen::Transform<Scalar, 3, Eigen::Isometry>&>());
Expand Down

0 comments on commit a802537

Please sign in to comment.