From ed2a2821aee82374785c53d032e728907fff7b98 Mon Sep 17 00:00:00 2001 From: Yoshiki Kanemoto Date: Fri, 12 Jan 2024 15:38:47 +0900 Subject: [PATCH] do not release GIL on box and sphere kinbody init. add GIL release on ExtractInfo --- python/bindings/openravepy_kinbody.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/bindings/openravepy_kinbody.cpp b/python/bindings/openravepy_kinbody.cpp index 2ee8ac1f58..eb238ecf5c 100644 --- a/python/bindings/openravepy_kinbody.cpp +++ b/python/bindings/openravepy_kinbody.cpp @@ -2733,7 +2733,6 @@ bool PyKinBody::InitFromBoxes(const boost::multi_array& vboxes, bool bD vaabbs[i].pos = Vector(vboxes[i][0],vboxes[i][1],vboxes[i][2]); vaabbs[i].extents = Vector(vboxes[i][3],vboxes[i][4],vboxes[i][5]); } - openravepy::PythonThreadSaver threadsaver; return _pbody->InitFromBoxes(vaabbs,bDraw,uri); } @@ -2759,7 +2758,6 @@ bool PyKinBody::InitFromSpheres(const boost::multi_array& vspheres, boo for(size_t i = 0; i < vvspheres.size(); ++i) { vvspheres[i] = Vector(vspheres[i][0],vspheres[i][1],vspheres[i][2],vspheres[i][3]); } - openravepy::PythonThreadSaver threadsaver; return _pbody->InitFromSpheres(vvspheres,bDraw,uri); } @@ -4288,7 +4286,10 @@ PyStateRestoreContextBase* PyKinBody::CreateKinBodyStateSaver(object options) object PyKinBody::ExtractInfo(ExtractInfoOptions options) const { KinBody::KinBodyInfo info; - _pbody->ExtractInfo(info, options); + { + openravepy::PythonThreadSaver threadsaver; + _pbody->ExtractInfo(info, options); + } return py::to_object(boost::shared_ptr(new PyKinBody::PyKinBodyInfo(info))); }