Skip to content

Commit 0694c9f

Browse files
Gave Duration a __repr__
1 parent 9ad67fa commit 0694c9f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/python.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,14 @@ PYBIND11_MODULE(_franky, m) {
144144
.def(py::self * uint64_t())
145145
.def(py::self *= uint64_t())
146146
.def(py::self / uint64_t())
147-
.def(py::self /= uint64_t());
147+
.def(py::self /= uint64_t())
148+
.def("__repr__",
149+
[](const franka::Duration &duration) {
150+
std::stringstream ss;
151+
ss << "Duration(" << duration.toMSec() << ")";
152+
return ss.str();
153+
}
154+
);
148155

149156
py::class_<RelativeDynamicsFactor>(m, "RelativeDynamicsFactor")
150157
.def(py::init<>())

0 commit comments

Comments
 (0)