Skip to content

Commit 0ef80ab

Browse files
author
Tim Schneider
committed
Releasing the GIL when controlling the gripper. Addresses issues mentioned in #15
1 parent 308704c commit 0ef80ab

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

python/python.cpp

+12-10
Original file line numberDiff line numberDiff line change
@@ -887,21 +887,23 @@ PYBIND11_MODULE(_franky, m) {
887887
"speed"_a,
888888
"force"_a,
889889
"epsilon_inner"_a = 0.005,
890-
"epsilon_outer"_a = 0.005)
890+
"epsilon_outer"_a = 0.005,
891+
py::call_guard<py::gil_scoped_release>())
891892
.def("grasp_async", &Gripper::graspAsync,
892893
"width"_a,
893894
"speed"_a,
894895
"force"_a,
895896
"epsilon_inner"_a = 0.005,
896-
"epsilon_outer"_a = 0.005)
897-
.def("move", &Gripper::move, "width"_a, "speed"_a)
898-
.def("move_async", &Gripper::moveAsync, "width"_a, "speed"_a)
899-
.def("open", &Gripper::open, "speed"_a)
900-
.def("open_async", &Gripper::openAsync, "speed"_a)
901-
.def("homing", &Gripper::homing)
902-
.def("homing_async", &Gripper::homingAsync)
903-
.def("stop", &Gripper::stop)
904-
.def("stop_async", &Gripper::stopAsync)
897+
"epsilon_outer"_a = 0.005,
898+
py::call_guard<py::gil_scoped_release>())
899+
.def("move", &Gripper::move, "width"_a, "speed"_a, py::call_guard<py::gil_scoped_release>())
900+
.def("move_async", &Gripper::moveAsync, "width"_a, "speed"_a, py::call_guard<py::gil_scoped_release>())
901+
.def("open", &Gripper::open, "speed"_a, py::call_guard<py::gil_scoped_release>())
902+
.def("open_async", &Gripper::openAsync, "speed"_a, py::call_guard<py::gil_scoped_release>())
903+
.def("homing", &Gripper::homing, py::call_guard<py::gil_scoped_release>())
904+
.def("homing_async", &Gripper::homingAsync, py::call_guard<py::gil_scoped_release>())
905+
.def("stop", &Gripper::stop, py::call_guard<py::gil_scoped_release>())
906+
.def("stop_async", &Gripper::stopAsync, py::call_guard<py::gil_scoped_release>())
905907
.def_property_readonly("state", &Gripper::state)
906908
.def_property_readonly("server_version", (uint16_t (Gripper::*)()) &Gripper::serverVersion)
907909
.def_property_readonly("width", &Gripper::width)

0 commit comments

Comments
 (0)