From 8286919750258c9679072859a013888cac68d2a6 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Wed, 2 Apr 2014 15:51:02 +0000 Subject: [PATCH] Standalone version: -fixed ICP odometry selection, -install of rtabmap-databaseViewer git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1286 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- .../include/rtabmap/gui/PreferencesDialog.h | 9 +++--- guilib/src/MainWindow.cpp | 22 +++++++++++--- guilib/src/PreferencesDialog.cpp | 29 +++++++++++-------- guilib/src/ui/preferencesDialog.ui | 10 +++---- tools/DatabaseViewer/CMakeLists.txt | 4 ++- 5 files changed, 47 insertions(+), 27 deletions(-) diff --git a/guilib/include/rtabmap/gui/PreferencesDialog.h b/guilib/include/rtabmap/gui/PreferencesDialog.h index 82489900..2c8cfad6 100644 --- a/guilib/include/rtabmap/gui/PreferencesDialog.h +++ b/guilib/include/rtabmap/gui/PreferencesDialog.h @@ -77,7 +77,7 @@ public: kSrcVideo }; - enum OdomTest { + enum OdomType { kOdomBIN, kOdomBOW, kOdomICP @@ -137,8 +137,7 @@ public: bool isSourceImageUsed() const; bool isSourceDatabaseUsed() const; bool isSourceOpenniUsed() const; - bool isSourceOpenniOdometryBIN() const; - bool isSourceOpenniOdometryBOW() const; + OdomType getOdometryType() const; bool getGeneralAutoRestart() const; bool getGeneralCameraKeypoints() const; int getSourceImageType() const; @@ -217,7 +216,7 @@ private slots: void updateBasicParameter(); void openDatabaseViewer(); void cleanOdometryTest(); - void testSourceOdometry(); + void testOdometry(); protected: virtual void showEvent ( QShowEvent * event ); @@ -252,7 +251,7 @@ private: void addParameters(const QGroupBox * box); QList getGroupBoxes(); void readSettingsBegin(); - void testOdometry(OdomTest test); + void testOdometry(OdomType type); protected: rtabmap::ParametersMap _parameters; diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index 30d7cee7..a75a2259 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -1948,14 +1948,21 @@ void MainWindow::startDetection() delete _odomThread; } Odometry * odom; - if(_preferencesDialog->isSourceOpenniOdometryBIN()) + if(_preferencesDialog->getOdometryType() == PreferencesDialog::kOdomBIN) { + UINFO("Using odometry FAST/BRIEF"); odom = new OdometryBinary(parameters); } - else //BOW + else if(_preferencesDialog->getOdometryType() == PreferencesDialog::kOdomBOW) { + UINFO("Using odometry SIFT/SURF"); odom = new OdometryBOW(parameters); } + else + { + UINFO("Using odometry ICP"); + odom = new OdometryICP(parameters); + } _odomThread = new OdometryThread(odom); UEventsManager::addHandler(_odomThread); @@ -2005,14 +2012,21 @@ void MainWindow::startDetection() delete _odomThread; } Odometry * odom; - if(_preferencesDialog->isSourceOpenniOdometryBIN()) + if(_preferencesDialog->getOdometryType() == PreferencesDialog::kOdomBIN) { + UINFO("Using odometry FAST/BRIEF"); odom = new OdometryBinary(parameters); } - else //BOW + else if(_preferencesDialog->getOdometryType() == PreferencesDialog::kOdomBOW) { + UINFO("Using odometry SIFT/SURF"); odom = new OdometryBOW(parameters); } + else + { + UINFO("Using odometry ICP"); + odom = new OdometryICP(parameters); + } _odomThread = new OdometryThread(odom); UEventsManager::addHandler(_odomThread); diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index ae381a39..cfb32f6d 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -88,7 +88,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) : connect(_ui->pushButton_saveConfig, SIGNAL(clicked()), this, SLOT(saveConfigTo())); connect(_ui->pushButton_resetConfig, SIGNAL(clicked()), this, SLOT(resetConfig())); connect(_ui->radioButton_basic, SIGNAL(toggled(bool)), this, SLOT(setupTreeView())); - connect(_ui->pushButton_testSourceOdometry, SIGNAL(clicked()), this, SLOT(testSourceOdometry())); + connect(_ui->pushButton_testOdometry, SIGNAL(clicked()), this, SLOT(testOdometry())); // General panel connect(_ui->general_checkBox_imagesKept, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteGeneralPanel())); @@ -2367,13 +2367,18 @@ bool PreferencesDialog::isSourceOpenniUsed() const { return _ui->groupBox_sourceOpenni->isChecked(); } -bool PreferencesDialog::isSourceOpenniOdometryBOW() const + +PreferencesDialog::OdomType PreferencesDialog::getOdometryType() const { - return _ui->odom_type->currentIndex() == 0; -} -bool PreferencesDialog::isSourceOpenniOdometryBIN() const -{ - return _ui->odom_type->currentIndex() == 1; + if(_ui->odom_type->currentIndex() == 0) + { + return kOdomBOW; + } + else if(_ui->odom_type->currentIndex() == 1) + { + return kOdomBIN; + } + return kOdomICP; } bool PreferencesDialog::getGeneralAutoRestart() const @@ -2606,7 +2611,7 @@ void PreferencesDialog::setSLAMMode(bool enabled) } } -void PreferencesDialog::testSourceOdometry() +void PreferencesDialog::testOdometry() { if(_ui->odom_type->currentIndex() == 0) { @@ -2622,7 +2627,7 @@ void PreferencesDialog::testSourceOdometry() } } -void PreferencesDialog::testOdometry(OdomTest test) +void PreferencesDialog::testOdometry(OdomType type) { UASSERT(_odomCamera == 0 && _odomThread == 0); @@ -2635,11 +2640,11 @@ void PreferencesDialog::testOdometry(OdomTest test) { Odometry * odometry; ParametersMap parameters = this->getAllParameters(); - if(test == kOdomBIN) + if(type == kOdomBIN) { odometry = new OdometryBinary(parameters); } - else if(test == kOdomICP) + else if(type == kOdomICP) { odometry = new OdometryICP(parameters); } @@ -2653,7 +2658,7 @@ void PreferencesDialog::testOdometry(OdomTest test) QWidget * window = new QWidget(this, Qt::Popup); window->setAttribute(Qt::WA_DeleteOnClose); window->setWindowFlags(Qt::Dialog); - window->setWindowTitle(tr("%1 Odometry viewer").arg(test==kOdomBIN?"Binary":"Bag-of-words")); + window->setWindowTitle(tr("%1 Odometry viewer").arg(type==kOdomBIN?"Binary":"Bag-of-words")); window->setMinimumWidth(800); window->setMinimumHeight(600); connect( window, SIGNAL(destroyed(QObject*)), this, SLOT(cleanOdometryTest()) ); diff --git a/guilib/src/ui/preferencesDialog.ui b/guilib/src/ui/preferencesDialog.ui index 3bc8a385..5623d855 100644 --- a/guilib/src/ui/preferencesDialog.ui +++ b/guilib/src/ui/preferencesDialog.ui @@ -64,8 +64,8 @@ 0 0 - 761 - 981 + 777 + 826 @@ -86,7 +86,7 @@ QFrame::Raised - 12 + 15 @@ -4919,7 +4919,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag - Brute force nerarest neighbor matching. If false, FLANN LSH index is used. + Brute force nearest neighbor matching. If false, FLANN LSH index is used. true @@ -5138,7 +5138,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag - + Test selected odometry diff --git a/tools/DatabaseViewer/CMakeLists.txt b/tools/DatabaseViewer/CMakeLists.txt index 5ac04cc2..3de21e3d 100644 --- a/tools/DatabaseViewer/CMakeLists.txt +++ b/tools/DatabaseViewer/CMakeLists.txt @@ -30,4 +30,6 @@ TARGET_LINK_LIBRARIES(databaseViewer rtabmap_core rtabmap_gui rtabmap_utilite ${ SET_TARGET_PROPERTIES( databaseViewer PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-databaseViewer) - +INSTALL(TARGETS databaseViewer + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT runtime + BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)