SuperPoint: return at minimum 2 features or 0 (fixed crash when only one feature). Python: added main python instance from Rtabmap object (to get python instancied once for ROS). MultiSessionWidget: Fixed layout warning. Memory::computeTransform() avoid re-instanciating RegistrationVis when Reg/Strategy=1 for guess transform (to fix PyMatcher re-initialized every time). CMake: added video module to opencv required components.

This commit is contained in:
matlabbe
2022-02-15 01:28:38 -05:00
parent 578c19cc38
commit 9bd758a62c
10 changed files with 87 additions and 23 deletions

View File

@@ -22,6 +22,7 @@ PythonInterface::PythonInterface() :
UScopeMutex lockM(mutex_);
if(refCount_ == 0)
{
UINFO("Py_Initialize() with thread = %d", UThread::currentThreadId());
// initialize Python
Py_Initialize();
@@ -44,6 +45,7 @@ PythonInterface::~PythonInterface()
if(refCount_>0 && --refCount_==0)
{
// shut down the interpreter
UINFO("Py_Finalize() with thread = %d", UThread::currentThreadId());
PyEval_RestoreThread(mainThreadState_);
Py_Finalize();
}
@@ -53,6 +55,7 @@ void PythonInterface::lock()
{
mutex_.lock();
UDEBUG("Lock: Current thread=%d (main=%d)", UThread::currentThreadId(), mainThreadID_);
if(UThread::currentThreadId() == mainThreadID_)
{
PyEval_RestoreThread(mainThreadState_);
@@ -77,6 +80,7 @@ void PythonInterface::unlock()
PyThreadState_Clear(threadState_);
PyThreadState_DeleteCurrent();
}
UDEBUG("Unlock: Current thread=%d (main=%d)", UThread::currentThreadId(), mainThreadID_);
mutex_.unlock();
}