diff --git a/sophus_pybind/bindings.cpp b/sophus_pybind/bindings.cpp index cb9d5e99..4b0a12e3 100644 --- a/sophus_pybind/bindings.cpp +++ b/sophus_pybind/bindings.cpp @@ -1,3 +1,40 @@ +#include #include "SophusPyBind.h" -PYBIND11_MODULE(sophus_pybind, m) { Sophus::exportSophus(m); } +namespace py = pybind11; + +PYBIND11_MODULE(sophus_pybind, m) { + Sophus::exportSophus(m); + + m.def( + "interpolate", + [](Sophus::SE3d const& a, Sophus::SE3d const& b, double t) { + return Sophus::interpolate(a, b, t); + }, + py::arg("a"), py::arg("b"), py::arg("t"), + "Interpolates between two SE3 poses"); + + m.def( + "interpolate", + [](Sophus::SO3d const& a, Sophus::SO3d const& b, double t) { + return Sophus::interpolate(a, b, t); + }, + py::arg("a"), py::arg("b"), py::arg("t"), + "Interpolates between two SO3 rotations"); + + m.def( + "interpolate", + [](Sophus::SE2d const& a, Sophus::SE2d const& b, double t) { + return Sophus::interpolate(a, b, t); + }, + py::arg("a"), py::arg("b"), py::arg("t"), + "Interpolates between two SE2 poses"); + + m.def( + "interpolate", + [](Sophus::SO2d const& a, Sophus::SO2d const& b, double t) { + return Sophus::interpolate(a, b, t); + }, + py::arg("a"), py::arg("b"), py::arg("t"), + "Interpolates between two SO2 rotations"); +}