DbViewer: added option to align scans/clouds to ground truth for convenience

This commit is contained in:
matlabbe
2018-02-21 15:13:02 -05:00
parent 1bfde1f9f0
commit 93e1d732c9
3 changed files with 95 additions and 33 deletions

View File

@@ -348,8 +348,8 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
//connect(ui_->graphicsView_B, SIGNAL(configChanged()), this, SLOT(configModified())); //connect(ui_->graphicsView_B, SIGNAL(configChanged()), this, SLOT(configModified()));
connect(ui_->comboBox_logger_level, SIGNAL(currentIndexChanged(int)), this, SLOT(configModified())); connect(ui_->comboBox_logger_level, SIGNAL(currentIndexChanged(int)), this, SLOT(configModified()));
connect(ui_->actionVertical_Layout, SIGNAL(toggled(bool)), this, SLOT(configModified())); connect(ui_->actionVertical_Layout, SIGNAL(toggled(bool)), this, SLOT(configModified()));
connect(ui_->checkBox_alignPosesWithGroundTruth, SIGNAL(stateChanged(int)), this, SLOT(configModified()));
connect(ui_->checkBox_alignPosesWithGroundTruth, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView())); connect(ui_->checkBox_alignPosesWithGroundTruth, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->checkBox_alignScansCloudsWithGroundTruth, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->checkBox_ignoreIntermediateNodes, SIGNAL(stateChanged(int)), this, SLOT(configModified())); connect(ui_->checkBox_ignoreIntermediateNodes, SIGNAL(stateChanged(int)), this, SLOT(configModified()));
connect(ui_->checkBox_ignoreIntermediateNodes, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView())); connect(ui_->checkBox_ignoreIntermediateNodes, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->checkBox_timeStats, SIGNAL(stateChanged(int)), this, SLOT(configModified())); connect(ui_->checkBox_timeStats, SIGNAL(stateChanged(int)), this, SLOT(configModified()));
@@ -634,6 +634,7 @@ void DatabaseViewer::restoreDefaultSettings()
// reset GUI parameters // reset GUI parameters
ui_->comboBox_logger_level->setCurrentIndex(1); ui_->comboBox_logger_level->setCurrentIndex(1);
ui_->checkBox_alignPosesWithGroundTruth->setChecked(true); ui_->checkBox_alignPosesWithGroundTruth->setChecked(true);
ui_->checkBox_alignScansCloudsWithGroundTruth->setChecked(false);
ui_->checkBox_ignoreIntermediateNodes->setChecked(false); ui_->checkBox_ignoreIntermediateNodes->setChecked(false);
ui_->checkBox_timeStats->setChecked(true); ui_->checkBox_timeStats->setChecked(true);
@@ -923,12 +924,14 @@ bool DatabaseViewer::closeDatabase()
ui_->toolBox_statistics->clear(); ui_->toolBox_statistics->clear();
databaseFileName_.clear(); databaseFileName_.clear();
ui_->checkBox_alignPosesWithGroundTruth->setVisible(false); ui_->checkBox_alignPosesWithGroundTruth->setVisible(false);
ui_->checkBox_alignScansCloudsWithGroundTruth->setVisible(false);
ui_->doubleSpinBox_optimizationScale->setVisible(false); ui_->doubleSpinBox_optimizationScale->setVisible(false);
ui_->label_scale_title->setVisible(false); ui_->label_scale_title->setVisible(false);
ui_->label_rmse->setVisible(false); ui_->label_rmse->setVisible(false);
ui_->label_rmse_title->setVisible(false); ui_->label_rmse_title->setVisible(false);
ui_->checkBox_ignoreIntermediateNodes->setVisible(false); ui_->checkBox_ignoreIntermediateNodes->setVisible(false);
ui_->label_alignPosesWithGroundTruth->setVisible(false); ui_->label_alignPosesWithGroundTruth->setVisible(false);
ui_->label_alignScansCloudsWithGroundTruth->setVisible(false);
ui_->label_optimizeFrom->setText(tr("Optimize from")); ui_->label_optimizeFrom->setText(tr("Optimize from"));
ui_->textEdit_info->clear(); ui_->textEdit_info->clear();
@@ -1435,12 +1438,14 @@ void DatabaseViewer::updateIds()
gpsPoses_.clear(); gpsPoses_.clear();
gpsValues_.clear(); gpsValues_.clear();
ui_->checkBox_alignPosesWithGroundTruth->setVisible(false); ui_->checkBox_alignPosesWithGroundTruth->setVisible(false);
ui_->checkBox_alignScansCloudsWithGroundTruth->setVisible(false);
ui_->doubleSpinBox_optimizationScale->setVisible(false); ui_->doubleSpinBox_optimizationScale->setVisible(false);
ui_->label_scale_title->setVisible(false); ui_->label_scale_title->setVisible(false);
ui_->label_rmse->setVisible(false); ui_->label_rmse->setVisible(false);
ui_->label_rmse_title->setVisible(false); ui_->label_rmse_title->setVisible(false);
ui_->checkBox_ignoreIntermediateNodes->setVisible(false); ui_->checkBox_ignoreIntermediateNodes->setVisible(false);
ui_->label_alignPosesWithGroundTruth->setVisible(false); ui_->label_alignPosesWithGroundTruth->setVisible(false);
ui_->label_alignScansCloudsWithGroundTruth->setVisible(false);
ui_->menuExport_GPS->setEnabled(false); ui_->menuExport_GPS->setEnabled(false);
ui_->actionPoses_KML->setEnabled(false); ui_->actionPoses_KML->setEnabled(false);
links_.clear(); links_.clear();
@@ -1578,9 +1583,12 @@ void DatabaseViewer::updateIds()
ui_->label_rmse->setVisible(true); ui_->label_rmse->setVisible(true);
ui_->label_rmse_title->setVisible(true); ui_->label_rmse_title->setVisible(true);
ui_->label_alignPosesWithGroundTruth->setVisible(true); ui_->label_alignPosesWithGroundTruth->setVisible(true);
if(!groundTruthPoses_.empty()) if(!groundTruthPoses_.empty())
{ {
ui_->label_alignPosesWithGroundTruth->setText(tr("Align poses with ground truth")); ui_->label_alignPosesWithGroundTruth->setText(tr("Align poses with ground truth"));
ui_->checkBox_alignScansCloudsWithGroundTruth->setVisible(true);
ui_->label_alignScansCloudsWithGroundTruth->setVisible(true);
} }
else else
{ {
@@ -2018,7 +2026,15 @@ void DatabaseViewer::exportPoses(int format)
return; return;
} }
std::map<int, Transform> optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value()); std::map<int, Transform> optimizedPoses;
if(ui_->checkBox_alignScansCloudsWithGroundTruth->isChecked() && !groundTruthPoses_.empty())
{
optimizedPoses = groundTruthPoses_;
}
else
{
optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value());
}
if(optimizedPoses.size()) if(optimizedPoses.size())
{ {
@@ -2583,7 +2599,15 @@ void DatabaseViewer::view3DMap()
} }
} }
std::map<int, Transform> optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value()); std::map<int, Transform> optimizedPoses;
if(ui_->checkBox_alignScansCloudsWithGroundTruth->isChecked() && !groundTruthPoses_.empty())
{
optimizedPoses = groundTruthPoses_;
}
else
{
optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value());
}
if(ui_->groupBox_posefiltering->isChecked()) if(ui_->groupBox_posefiltering->isChecked())
{ {
optimizedPoses = graph::radiusPosesFiltering(optimizedPoses, optimizedPoses = graph::radiusPosesFiltering(optimizedPoses,
@@ -2626,7 +2650,15 @@ void DatabaseViewer::generate3DMap()
} }
} }
std::map<int, Transform> optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value()); std::map<int, Transform> optimizedPoses;
if(ui_->checkBox_alignScansCloudsWithGroundTruth->isChecked() && !groundTruthPoses_.empty())
{
optimizedPoses = groundTruthPoses_;
}
else
{
optimizedPoses = uValueAt(graphes_, ui_->horizontalSlider_iterations->value());
}
if(ui_->groupBox_posefiltering->isChecked()) if(ui_->groupBox_posefiltering->isChecked())
{ {
optimizedPoses = graph::radiusPosesFiltering(optimizedPoses, optimizedPoses = graph::radiusPosesFiltering(optimizedPoses,
@@ -4492,7 +4524,15 @@ void DatabaseViewer::sliderIterationsValueChanged(int value)
} }
} }
std::map<int, rtabmap::Transform> graphFiltered = graph; std::map<int, rtabmap::Transform> graphFiltered;
if(ui_->checkBox_alignScansCloudsWithGroundTruth->isChecked() && !groundTruthPoses_.empty())
{
graphFiltered = groundTruthPoses_;
}
else
{
graphFiltered = graph;
}
if(ui_->groupBox_posefiltering->isChecked()) if(ui_->groupBox_posefiltering->isChecked())
{ {
graphFiltered = graph::radiusPosesFiltering(graph, graphFiltered = graph::radiusPosesFiltering(graph,

View File

@@ -286,11 +286,11 @@ GraphViewer::GraphViewer(QWidget * parent) :
_graphRoot->setParentItem(_root); _graphRoot->setParentItem(_root);
_globalPathRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001)); _globalPathRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001));
_globalPathRoot->setZValue(5); _globalPathRoot->setZValue(8);
_globalPathRoot->setParentItem(_root); _globalPathRoot->setParentItem(_root);
_localPathRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001)); _localPathRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001));
_localPathRoot->setZValue(6); _localPathRoot->setZValue(9);
_localPathRoot->setParentItem(_root); _localPathRoot->setParentItem(_root);
_gtGraphRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001)); _gtGraphRoot = (QGraphicsItem *)this->scene()->addEllipse(QRectF(-0.0001,-0.0001,0.0001,0.0001));
@@ -441,11 +441,12 @@ void GraphViewer::updateGraph(const std::map<int, Transform> & poses,
if(_intraInterSessionColors) if(_intraInterSessionColors)
{ {
linkItem->setColor(interSessionClosure?_loopInterSessionColor:_loopIntraSessionColor); linkItem->setColor(interSessionClosure?_loopInterSessionColor:_loopIntraSessionColor);
linkItem->setZValue(interSessionClosure?8:9); linkItem->setZValue(interSessionClosure?6:7);
} }
else else
{ {
linkItem->setColor(_loopClosureLocalColor); linkItem->setColor(_loopClosureLocalColor);
linkItem->setZValue(7);
} }
} }
else else
@@ -458,6 +459,7 @@ void GraphViewer::updateGraph(const std::map<int, Transform> & poses,
else else
{ {
linkItem->setColor(_loopClosureColor); linkItem->setColor(_loopClosureColor);
linkItem->setZValue(9);
} }
} }

View File

@@ -921,7 +921,7 @@
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout_5" columnstretch="0,1"> <layout class="QGridLayout" name="gridLayout_5" columnstretch="0,1">
<item row="8" column="0"> <item row="9" column="0">
<widget class="QLabel" name="label_loopClosures"> <widget class="QLabel" name="label_loopClosures">
<property name="text"> <property name="text">
<string/> <string/>
@@ -931,7 +931,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_timeGrid"> <widget class="QLabel" name="label_timeGrid">
<property name="text"> <property name="text">
<string/> <string/>
@@ -941,7 +941,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_timeOptimization"> <widget class="QLabel" name="label_timeOptimization">
<property name="text"> <property name="text">
<string/> <string/>
@@ -954,42 +954,42 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QSpinBox" name="spinBox_optimizationsFrom"/> <widget class="QSpinBox" name="spinBox_optimizationsFrom"/>
</item> </item>
<item row="7" column="1"> <item row="8" column="1">
<widget class="QLabel" name="label_52"> <widget class="QLabel" name="label_52">
<property name="text"> <property name="text">
<string>Poses</string> <string>Poses</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QLabel" name="label_39"> <widget class="QLabel" name="label_39">
<property name="text"> <property name="text">
<string>Time optimization (s)</string> <string>Time optimization (s)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="9" column="1">
<widget class="QLabel" name="label_41"> <widget class="QLabel" name="label_41">
<property name="text"> <property name="text">
<string>Links (N, NM, G, LS, LT, U, P)</string> <string>Links (N, NM, G, LS, LT, U, P)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="4" column="1">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string>Path length (m)</string> <string>Path length (m)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="6" column="1">
<widget class="QLabel" name="label_45"> <widget class="QLabel" name="label_45">
<property name="text"> <property name="text">
<string>Time grid (s)</string> <string>Time grid (s)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_pathLength"> <widget class="QLabel" name="label_pathLength">
<property name="text"> <property name="text">
<string/> <string/>
@@ -1020,7 +1020,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label_poses"> <widget class="QLabel" name="label_poses">
<property name="text"> <property name="text">
<string/> <string/>
@@ -1040,6 +1040,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBox_ignoreIntermediateNodes">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QCheckBox" name="checkBox_alignPosesWithGroundTruth"> <widget class="QCheckBox" name="checkBox_alignPosesWithGroundTruth">
<property name="text"> <property name="text">
@@ -1050,18 +1060,18 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="7" column="0">
<widget class="QCheckBox" name="checkBox_ignoreIntermediateNodes"> <widget class="QLabel" name="label_rmse">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="checked"> <property name="textInteractionFlags">
<bool>false</bool> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="QLabel" name="label_alignPosesWithGroundTruth_2"> <widget class="QLabel" name="label_ignoreINtermediateNdoes">
<property name="text"> <property name="text">
<string>Ignore intermediate nodes</string> <string>Ignore intermediate nodes</string>
</property> </property>
@@ -1070,20 +1080,30 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="7" column="1">
<widget class="QLabel" name="label_rmse_title"> <widget class="QLabel" name="label_rmse_title">
<property name="text"> <property name="text">
<string>RMSE (m)</string> <string>RMSE (m)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="2" column="1">
<widget class="QLabel" name="label_rmse"> <widget class="QLabel" name="label_alignScansCloudsWithGroundTruth">
<property name="text">
<string>Align scans/clouds with ground truth</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_alignScansCloudsWithGroundTruth">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="textInteractionFlags"> <property name="checked">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -1840,8 +1860,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>205</width> <width>298</width>
<height>117</height> <height>179</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@@ -1940,8 +1960,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>185</width> <width>433</width>
<height>487</height> <height>198</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">