mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Rtabmap: Refactoring... removed all threading/events related stuff from Rtabmap object to RtabmapThread object (a thread wrapper of the rtabmap object)
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@803 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include "utilite/UEventsManager.h"
|
||||
#include "rtabmap/core/Rtabmap.h"
|
||||
#include "rtabmap/core/RtabmapThread.h"
|
||||
#include "rtabmap/gui/MainWindow.h"
|
||||
#include <QtGui/QMessageBox>
|
||||
#include "utilite/UObjDeletionThread.h"
|
||||
@@ -45,7 +45,7 @@ int main(int argc, char* argv[])
|
||||
/* Start thread's task */
|
||||
mainWindow->showNormal();
|
||||
|
||||
Rtabmap * rtabmap = new Rtabmap();
|
||||
RtabmapThread * rtabmap = new RtabmapThread();
|
||||
rtabmap->setWorkingDirectory(mainWindow->getWorkingDirectory().toStdString());
|
||||
rtabmap->start(); // start it not initialized... will be initialized by event from the gui
|
||||
UEventsManager::addHandler(rtabmap);
|
||||
@@ -74,7 +74,7 @@ int main(int argc, char* argv[])
|
||||
msg->setIconPixmap(QPixmap(":/images/RTAB-Map.ico"));
|
||||
msg->setWindowIcon(QIcon(":/images/RTAB-Map.ico"));
|
||||
msg->show();
|
||||
UObjDeletionThread<Rtabmap> delThread(rtabmap);
|
||||
UObjDeletionThread<RtabmapThread> delThread(rtabmap);
|
||||
ObjDeletionHandler handler(delThread.id(), app, SLOT(quit()));
|
||||
UEventsManager::addHandler(&handler);
|
||||
delThread.startDeletion(1); // make sure that app-exec() is called before the deletion of the object
|
||||
|
||||
Reference in New Issue
Block a user