Skip to content

Commit

Permalink
cosme, include a little more c++ computation into GIL unlock scope
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshikikanemoto committed Jan 12, 2024
1 parent 5310701 commit 78ceece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions python/bindings/openravepy_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2472,13 +2472,13 @@ object PyEnvironmentBase::plot3(object opoints,float pointsize,object ocolors, i
return toPyGraphHandle(phandle);
}
BOOST_ASSERT(vcolors.size()<=4);
RaveVector<float> vcolor;
for(int i = 0; i < (int)vcolors.size(); ++i) {
vcolor[i] = vcolors[i];
}
GraphHandlePtr phandle;
{
PythonThreadSaver saver;
RaveVector<float> vcolor;
for(int i = 0; i < (int)vcolors.size(); ++i) {
vcolor[i] = vcolors[i];
}
phandle = _penv->plot3(vpoints.data(),sizes.first,sizeof(float)*3,pointsize,vcolor,drawstyle);
}
return toPyGraphHandle(phandle);
Expand Down
16 changes: 8 additions & 8 deletions python/bindings/openravepy_kinbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ object PyGeometryInfo::SerializeJSON(dReal fUnitScale, object options)
{
rapidjson::Document doc;
KinBody::GeometryInfoPtr pgeominfo = GetGeometryInfo();
const int intOption = pyGetIntFromPy(options, 0);
const int intOptions = pyGetIntFromPy(options, 0);
{
openravepy::PythonThreadSaver threadsaver;
pgeominfo->SerializeJSON(doc, doc.GetAllocator(), fUnitScale, intOption);
pgeominfo->SerializeJSON(doc, doc.GetAllocator(), fUnitScale, intOptions);
}
return toPyObject(doc);
}
Expand All @@ -379,10 +379,10 @@ void PyGeometryInfo::DeserializeJSON(object obj, dReal fUnitScale, object option
rapidjson::Document doc;
toRapidJSONValue(obj, doc, doc.GetAllocator());
KinBody::GeometryInfoPtr pgeominfo = GetGeometryInfo();
const int intOption = pyGetIntFromPy(options, 0);
const int intOptions = pyGetIntFromPy(options, 0);
{
openravepy::PythonThreadSaver threadsaver;
pgeominfo->DeserializeJSON(doc, fUnitScale, intOption);
pgeominfo->DeserializeJSON(doc, fUnitScale, intOptions);
}
Init(*pgeominfo);
}
Expand Down Expand Up @@ -616,10 +616,10 @@ py::object PyLinkInfo::SerializeJSON(dReal fUnitScale, object options)
{
rapidjson::Document doc;
KinBody::LinkInfoPtr pInfo = GetLinkInfo();
const int intOption = pyGetIntFromPy(options, 0);
const int intOptions = pyGetIntFromPy(options, 0);
{
openravepy::PythonThreadSaver threadsaver;
pInfo->SerializeJSON(doc, doc.GetAllocator(), fUnitScale, intOption);
pInfo->SerializeJSON(doc, doc.GetAllocator(), fUnitScale, intOptions);
}
return toPyObject(doc);
}
Expand All @@ -629,10 +629,10 @@ void PyLinkInfo::DeserializeJSON(object obj, dReal fUnitScale, py::object option
rapidjson::Document doc;
toRapidJSONValue(obj, doc, doc.GetAllocator());
KinBody::LinkInfoPtr pInfo = GetLinkInfo();
const int intOption = pyGetIntFromPy(options, 0);
const int intOptions = pyGetIntFromPy(options, 0);
{
openravepy::PythonThreadSaver threadsaver;
pInfo->DeserializeJSON(doc, fUnitScale, intOption);
pInfo->DeserializeJSON(doc, fUnitScale, intOptions);
}
_Update(*pInfo);
}
Expand Down

0 comments on commit 78ceece

Please sign in to comment.