Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion sophus_pybind/bindings.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
#include <sophus/interpolate.hpp>
#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");
}
Loading