diff --git a/cmake_modules/FindUtiLite.cmake b/cmake_modules/FindUtiLite.cmake index e27ae573..ed7cc5c2 100644 --- a/cmake_modules/FindUtiLite.cmake +++ b/cmake_modules/FindUtiLite.cmake @@ -101,10 +101,10 @@ IF(URESOURCEGENERATOR_EXEC) ENDIF(UtiLite_LIBRARIES AND UtiLite_Audio) IF(UtiLite_LIBRARIES AND UtiLite_Cv) SET(UtiLite_LIBRARIES ${UtiLite_LIBRARIES} ${UtiLite_Cv}) - ENDIF(UtiLite_LIBRARIES AND UtiLite_Audio) + ENDIF(UtiLite_LIBRARIES AND UtiLite_Cv) IF(UtiLite_LIBRARIES AND UtiLite_Cvqt) SET(UtiLite_LIBRARIES ${UtiLite_LIBRARIES} ${UtiLite_Cvqt}) - ENDIF(UtiLite_LIBRARIES AND UtiLite_Audio) + ENDIF(UtiLite_LIBRARIES AND UtiLite_Cvqt) IF (UtiLite_INCLUDE_DIRS AND UtiLite_LIBRARIES) SET(UtiLite_FOUND TRUE) diff --git a/corelib/include/rtabmap/core/RtabmapEvent.h b/corelib/include/rtabmap/core/RtabmapEvent.h index 5a58b4fa..66c0f2f5 100644 --- a/corelib/include/rtabmap/core/RtabmapEvent.h +++ b/corelib/include/rtabmap/core/RtabmapEvent.h @@ -57,8 +57,6 @@ class RTABMAP_EXP Statistics RTABMAP_STATS(Memory, Signatures_removed,); RTABMAP_STATS(Memory, Signatures_retrieved,); RTABMAP_STATS(Memory, Images_buffered,); - RTABMAP_STATS(Memory, Similarities_map,); - RTABMAP_STATS(Memory, Loop_closures_map,); RTABMAP_STATS(Timing, Memory_update, ms); RTABMAP_STATS(Timing, Cleaning_neighbors, ms); diff --git a/guilib/include/rtabmap/gui/MainWindow.h b/guilib/include/rtabmap/gui/MainWindow.h index c920b2a9..9026e879 100644 --- a/guilib/include/rtabmap/gui/MainWindow.h +++ b/guilib/include/rtabmap/gui/MainWindow.h @@ -90,6 +90,7 @@ private slots: void startDetection(); void pauseDetection(); void stopDetection(); + void printLoopClosureIds(); void generateMap(); void generateLocalMap(); void deleteMemory(); @@ -175,6 +176,9 @@ private: QString _graphSavingFileName; QString _autoScreenCaptureFormat; + + QVector _refIds; + QVector _loopClosureIds; }; } diff --git a/guilib/src/ConsoleWidget.h b/guilib/src/ConsoleWidget.h index 78f0f947..4c9d8e7b 100644 --- a/guilib/src/ConsoleWidget.h +++ b/guilib/src/ConsoleWidget.h @@ -41,7 +41,7 @@ public: virtual ~ConsoleWidget(); public slots: - void appendMsg(const QString & msg, int level); + void appendMsg(const QString & msg, int level = 1); signals: void msgReceived(const QString &, int); diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index 2d2246cf..532c0904 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -189,6 +189,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : connect(_ui->actionDump_the_prediction_matrix, SIGNAL(triggered()), this, SLOT(dumpThePrediction())); connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache())); connect(_ui->actionAbout, SIGNAL(triggered()), _aboutDialog , SLOT(exec())); + connect(_ui->actionPrint_loop_closure_IDs_to_console, SIGNAL(triggered()), this, SLOT(printLoopClosureIds())); connect(_ui->actionGenerate_map, SIGNAL(triggered()), this , SLOT(generateMap())); connect(_ui->actionGenerate_local_map, SIGNAL(triggered()), this, SLOT(generateLocalMap())); connect(_ui->actionDelete_memory, SIGNAL(triggered()), this , SLOT(deleteMemory())); @@ -492,6 +493,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat) int rejectedHyp = bool(uValue(stat.data(), Statistics::kLoopRejectedHypothesis(), 0.0f)); float highestHypothesisValue = uValue(stat.data(), Statistics::kLoopHighest_hypothesis_value(), 0.0f); + int matchId = 0; if(highestHypothesisId > 0) { bool show = true; @@ -504,6 +506,7 @@ void MainWindow::processStats(const rtabmap::Statistics & stat) _ui->label_stats_loopClosuresReactivatedDetected->setText(QString::number(_ui->label_stats_loopClosuresReactivatedDetected->text().toInt() + 1)); } _ui->label_matchId->setText(QString("Match ID = %1").arg(stat.loopClosureId())); + matchId = stat.loopClosureId(); } else if(rejectedHyp && highestHypothesisValue >= _preferencesDialog->getLoopThr()) { @@ -547,6 +550,8 @@ void MainWindow::processStats(const rtabmap::Statistics & stat) } } } + _refIds.push_back(stat.refImageId()); + _loopClosureIds.push_back(matchId); if(_ui->imageView_loopClosure->items().size() || stat.loopClosureId()>0) { @@ -1222,6 +1227,25 @@ void MainWindow::stopDetection() } } +void MainWindow::printLoopClosureIds() +{ + _ui->dockWidget_console->show(); + QString msgRef; + QString msgLoop; + for(int i = 0; i<_refIds.size(); ++i) + { + msgRef.append(QString::number(_refIds[i])); + msgLoop.append(QString::number(_loopClosureIds[i])); + if(i < _refIds.size() - 1) + { + msgRef.append(" "); + msgLoop.append(" "); + } + } + _ui->widget_console->appendMsg(QString("IDs = [%1];").arg(msgRef)); + _ui->widget_console->appendMsg(QString("LoopIDs = [%1];").arg(msgLoop)); +} + void MainWindow::generateMap() { if(_graphSavingFileName.isEmpty()) @@ -1395,6 +1419,8 @@ void MainWindow::clearTheCache() _ui->label_stats_loopClosuresDetected->setText("0"); _ui->label_stats_loopClosuresReactivatedDetected->setText("0"); _ui->label_stats_loopClosuresRejected->setText("0"); + _refIds.clear(); + _loopClosureIds.clear(); } void MainWindow::updateElapsedTime() diff --git a/guilib/src/ui/mainWindow.ui b/guilib/src/ui/mainWindow.ui index 5ca1c238..e6e674c0 100644 --- a/guilib/src/ui/mainWindow.ui +++ b/guilib/src/ui/mainWindow.ui @@ -102,7 +102,7 @@ 0 0 1056 - 25 + 22 @@ -137,6 +137,7 @@ + @@ -510,7 +511,7 @@ 0 - + @@ -751,6 +752,11 @@ Generate local map... + + + Print loop closure IDs to console + +