Added PrintLoopClosureIDs action to Edit menu

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@664 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2012-12-11 19:41:44 +00:00
parent 2836d4c48c
commit 1efc675521
6 changed files with 41 additions and 7 deletions
+2 -2
View File
@@ -101,10 +101,10 @@ IF(URESOURCEGENERATOR_EXEC)
ENDIF(UtiLite_LIBRARIES AND UtiLite_Audio) ENDIF(UtiLite_LIBRARIES AND UtiLite_Audio)
IF(UtiLite_LIBRARIES AND UtiLite_Cv) IF(UtiLite_LIBRARIES AND UtiLite_Cv)
SET(UtiLite_LIBRARIES ${UtiLite_LIBRARIES} ${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) IF(UtiLite_LIBRARIES AND UtiLite_Cvqt)
SET(UtiLite_LIBRARIES ${UtiLite_LIBRARIES} ${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) IF (UtiLite_INCLUDE_DIRS AND UtiLite_LIBRARIES)
SET(UtiLite_FOUND TRUE) SET(UtiLite_FOUND TRUE)
@@ -57,8 +57,6 @@ class RTABMAP_EXP Statistics
RTABMAP_STATS(Memory, Signatures_removed,); RTABMAP_STATS(Memory, Signatures_removed,);
RTABMAP_STATS(Memory, Signatures_retrieved,); RTABMAP_STATS(Memory, Signatures_retrieved,);
RTABMAP_STATS(Memory, Images_buffered,); 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, Memory_update, ms);
RTABMAP_STATS(Timing, Cleaning_neighbors, ms); RTABMAP_STATS(Timing, Cleaning_neighbors, ms);
+4
View File
@@ -90,6 +90,7 @@ private slots:
void startDetection(); void startDetection();
void pauseDetection(); void pauseDetection();
void stopDetection(); void stopDetection();
void printLoopClosureIds();
void generateMap(); void generateMap();
void generateLocalMap(); void generateLocalMap();
void deleteMemory(); void deleteMemory();
@@ -175,6 +176,9 @@ private:
QString _graphSavingFileName; QString _graphSavingFileName;
QString _autoScreenCaptureFormat; QString _autoScreenCaptureFormat;
QVector<int> _refIds;
QVector<int> _loopClosureIds;
}; };
} }
+1 -1
View File
@@ -41,7 +41,7 @@ public:
virtual ~ConsoleWidget(); virtual ~ConsoleWidget();
public slots: public slots:
void appendMsg(const QString & msg, int level); void appendMsg(const QString & msg, int level = 1);
signals: signals:
void msgReceived(const QString &, int); void msgReceived(const QString &, int);
+26
View File
@@ -189,6 +189,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) :
connect(_ui->actionDump_the_prediction_matrix, SIGNAL(triggered()), this, SLOT(dumpThePrediction())); connect(_ui->actionDump_the_prediction_matrix, SIGNAL(triggered()), this, SLOT(dumpThePrediction()));
connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache())); connect(_ui->actionClear_cache, SIGNAL(triggered()), this, SLOT(clearTheCache()));
connect(_ui->actionAbout, SIGNAL(triggered()), _aboutDialog , SLOT(exec())); 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_map, SIGNAL(triggered()), this , SLOT(generateMap()));
connect(_ui->actionGenerate_local_map, SIGNAL(triggered()), this, SLOT(generateLocalMap())); connect(_ui->actionGenerate_local_map, SIGNAL(triggered()), this, SLOT(generateLocalMap()));
connect(_ui->actionDelete_memory, SIGNAL(triggered()), this , SLOT(deleteMemory())); 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)); int rejectedHyp = bool(uValue(stat.data(), Statistics::kLoopRejectedHypothesis(), 0.0f));
float highestHypothesisValue = uValue(stat.data(), Statistics::kLoopHighest_hypothesis_value(), 0.0f); float highestHypothesisValue = uValue(stat.data(), Statistics::kLoopHighest_hypothesis_value(), 0.0f);
int matchId = 0;
if(highestHypothesisId > 0) if(highestHypothesisId > 0)
{ {
bool show = true; 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_stats_loopClosuresReactivatedDetected->setText(QString::number(_ui->label_stats_loopClosuresReactivatedDetected->text().toInt() + 1));
} }
_ui->label_matchId->setText(QString("Match ID = %1").arg(stat.loopClosureId())); _ui->label_matchId->setText(QString("Match ID = %1").arg(stat.loopClosureId()));
matchId = stat.loopClosureId();
} }
else if(rejectedHyp && highestHypothesisValue >= _preferencesDialog->getLoopThr()) 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) 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() void MainWindow::generateMap()
{ {
if(_graphSavingFileName.isEmpty()) if(_graphSavingFileName.isEmpty())
@@ -1395,6 +1419,8 @@ void MainWindow::clearTheCache()
_ui->label_stats_loopClosuresDetected->setText("0"); _ui->label_stats_loopClosuresDetected->setText("0");
_ui->label_stats_loopClosuresReactivatedDetected->setText("0"); _ui->label_stats_loopClosuresReactivatedDetected->setText("0");
_ui->label_stats_loopClosuresRejected->setText("0"); _ui->label_stats_loopClosuresRejected->setText("0");
_refIds.clear();
_loopClosureIds.clear();
} }
void MainWindow::updateElapsedTime() void MainWindow::updateElapsedTime()
+8 -2
View File
@@ -102,7 +102,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1056</width> <width>1056</width>
<height>25</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@@ -137,6 +137,7 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionDump_the_memory"/> <addaction name="actionDump_the_memory"/>
<addaction name="actionDump_the_prediction_matrix"/> <addaction name="actionDump_the_prediction_matrix"/>
<addaction name="actionPrint_loop_closure_IDs_to_console"/>
<addaction name="actionGenerate_map"/> <addaction name="actionGenerate_map"/>
<addaction name="actionGenerate_local_map"/> <addaction name="actionGenerate_local_map"/>
<addaction name="actionReset_the_memory"/> <addaction name="actionReset_the_memory"/>
@@ -510,7 +511,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="rtabmap::ConsoleWidget" name="widget" native="true"/> <widget class="rtabmap::ConsoleWidget" name="widget_console" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -751,6 +752,11 @@
<string>Generate local map...</string> <string>Generate local map...</string>
</property> </property>
</action> </action>
<action name="actionPrint_loop_closure_IDs_to_console">
<property name="text">
<string>Print loop closure IDs to console</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>