mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user