Skip to content

Commit

Permalink
[exotica_python] Add __repr__ to KDLVector
Browse files Browse the repository at this point in the history
  • Loading branch information
wxmerkt committed Oct 23, 2023
1 parent b4761e3 commit fa9b721
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions exotica_python/src/pyexotica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ PYBIND11_MODULE(_pyexotica, module)
py::arg("x") = 0,
py::arg("y") = 0,
py::arg("z") = 0)
.def("__repr__", [](KDL::Vector* me) { return "KDL::Vector [" + std::to_string(me->data[0]) + ", " + std::to_string(me->data[1]) + ", " + std::to_string(me->data[2]) + "]"; })
.def("x", [](KDL::Vector& v) -> double& { return v[0]; })
.def("y", [](KDL::Vector& v) -> double& { return v[1]; })
.def("z", [](KDL::Vector& v) -> double& { return v[2]; })
Expand Down

0 comments on commit fa9b721

Please sign in to comment.