0.16.2: Added wm_state field to database's Statistics table. New parameter "Rtabmap/SaveWMState" (default false). DbViewer: added option in GraphView to show only poses of the root id that were in WM at that time

This commit is contained in:
matlabbe
2018-02-21 18:19:20 -05:00
parent 93e1d732c9
commit 297cf3f51e
16 changed files with 208 additions and 159 deletions

View File

@@ -315,6 +315,7 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
connect(ui_->horizontalSlider_iterations, SIGNAL(sliderMoved(int)), this, SLOT(sliderIterationsValueChanged(int)));
connect(ui_->spinBox_optimizationsFrom, SIGNAL(editingFinished()), this, SLOT(updateGraphView()));
connect(ui_->checkBox_spanAllMaps, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->checkBox_wmState, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->graphViewer, SIGNAL(mapShownRequested()), this, SLOT(updateGraphView()));
connect(ui_->checkBox_ignorePoseCorrection, SIGNAL(stateChanged(int)), this, SLOT(updateGraphView()));
connect(ui_->checkBox_ignorePoseCorrection, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView()));
@@ -639,6 +640,7 @@ void DatabaseViewer::restoreDefaultSettings()
ui_->checkBox_timeStats->setChecked(true);
ui_->checkBox_spanAllMaps->setChecked(true);
ui_->checkBox_wmState->setChecked(false);
ui_->checkBox_ignorePoseCorrection->setChecked(false);
ui_->checkBox_ignoreGlobalLoop->setChecked(false);
ui_->checkBox_ignoreLocalLoopSpace->setChecked(false);
@@ -907,6 +909,7 @@ bool DatabaseViewer::closeDatabase()
gpsValues_.clear();
mapIds_.clear();
weights_.clear();
wmStates_.clear();
links_.clear();
linksAdded_.clear();
linksRefined_.clear();
@@ -1433,10 +1436,12 @@ void DatabaseViewer::updateIds()
idToIndex_.clear();
mapIds_.clear();
weights_.clear();
wmStates_.clear();
odomPoses_.clear();
groundTruthPoses_.clear();
gpsPoses_.clear();
gpsValues_.clear();
ui_->checkBox_wmState->setVisible(false);
ui_->checkBox_alignPosesWithGroundTruth->setVisible(false);
ui_->checkBox_alignScansCloudsWithGroundTruth->setVisible(false);
ui_->doubleSpinBox_optimizationScale->setVisible(false);
@@ -1482,6 +1487,13 @@ void DatabaseViewer::updateIds()
dbDriver_->getNodeInfo(ids_[i], p, mapId, w, l, s, g, v, gps);
mapIds_.insert(std::make_pair(ids_[i], mapId));
weights_.insert(std::make_pair(ids_[i], w));
std::vector<int> wmState;
dbDriver_->getStatistics(ids_[i], s, &wmState);
if(!wmState.empty())
{
wmStates_.insert(std::make_pair(ids_[i], wmState));
ui_->checkBox_wmState->setVisible(true);
}
if(w < 0)
{
ui_->checkBox_ignoreIntermediateNodes->setVisible(true);
@@ -4867,6 +4879,27 @@ void DatabaseViewer::updateGraphView()
graphLinks_.clear();
std::map<int, rtabmap::Transform> poses = odomPoses_;
if(ui_->checkBox_wmState->isChecked() && uContains(wmStates_, fromId))
{
std::map<int, rtabmap::Transform> wmPoses;
std::vector<int> & wmState = wmStates_.at(fromId);
for(unsigned int i=0; i<wmState.size(); ++i)
{
std::map<int, rtabmap::Transform>::iterator iter = poses.find(wmState[i]);
if(iter!=poses.end())
{
wmPoses.insert(*iter);
}
}
if(!wmPoses.empty())
{
poses = wmPoses;
}
else
{
UWARN("Empty WM poses!? Ignoring WM state... (root id=%d, wmState=%d)", fromId, wmState.size());
}
}
// filter current map if not spanning to all maps
if(!ui_->checkBox_spanAllMaps->isChecked() && uContains(mapIds_, fromId) && mapIds_.at(fromId) >= 0)

View File

@@ -662,6 +662,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->general_checkBox_publishPdf->setObjectName(Parameters::kRtabmapPublishPdf().c_str());
_ui->general_checkBox_publishLikelihood->setObjectName(Parameters::kRtabmapPublishLikelihood().c_str());
_ui->general_checkBox_publishRMSE->setObjectName(Parameters::kRtabmapComputeRMSE().c_str());
_ui->general_checkBox_saveWMState->setObjectName(Parameters::kRtabmapSaveWMState().c_str());
_ui->general_checkBox_publishRAM->setObjectName(Parameters::kRtabmapPublishRAMUsage().c_str());
_ui->general_checkBox_statisticLogsBufferedInRAM->setObjectName(Parameters::kRtabmapStatisticLogsBufferedInRAM().c_str());
_ui->groupBox_statistics->setObjectName(Parameters::kRtabmapStatisticLogged().c_str());

View File

@@ -21,16 +21,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -61,8 +52,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>242</height>
<width>353</width>
<height>256</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
@@ -253,8 +244,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>242</height>
<width>353</width>
<height>256</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
@@ -434,16 +425,7 @@
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>12</number>
</property>
<item>
@@ -499,16 +481,7 @@
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>12</number>
</property>
<item>
@@ -579,7 +552,7 @@
<x>0</x>
<y>0</y>
<width>1547</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -1000,7 +973,7 @@
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,1">
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0,1">
<item>
<widget class="QLabel" name="label_optimizeFrom">
<property name="text">
@@ -1018,6 +991,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_wmState">
<property name="text">
<string>WM</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0">
@@ -1127,16 +1107,7 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents_3">
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -1183,15 +1154,15 @@
<item>
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="page_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>318</width>
<height>219</height>
<width>419</width>
<height>222</height>
</rect>
</property>
<attribute name="label">
@@ -1352,8 +1323,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>522</width>
<height>773</height>
<width>419</width>
<height>831</height>
</rect>
</property>
<attribute name="label">
@@ -1860,8 +1831,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>298</width>
<height>179</height>
<width>201</width>
<height>126</height>
</rect>
</property>
<attribute name="label">
@@ -1960,8 +1931,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>433</width>
<height>198</height>
<width>186</width>
<height>496</height>
</rect>
</property>
<attribute name="label">
@@ -2063,16 +2034,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -2185,16 +2147,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -2325,16 +2278,7 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents_7">
<layout class="QVBoxLayout" name="verticalLayout_13">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -2352,16 +2296,7 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents_5">
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@@ -2406,16 +2341,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>

View File

@@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-78</y>
<y>0</y>
<width>673</width>
<height>2834</height>
</rect>
@@ -86,7 +86,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>7</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
@@ -6172,32 +6172,12 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
<item>
<widget class="QGroupBox" name="groupBox_publishing">
<property name="title">
<string>Publish statistics (stuff to be shown in the GUI)</string>
<string>Publish statistics (stuff to be shown in the GUI) and save them in database</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_45" columnstretch="0,1">
<item row="0" column="0">
<widget class="QCheckBox" name="general_checkBox_publishRawData">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_91">
<property name="text">
<string>Publish signature data.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="general_checkBox_publishPdf">
<property name="text">
@@ -6228,6 +6208,36 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_462">
<property name="text">
<string>Save working memory state after each update.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="general_checkBox_publishRawData">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_91">
<property name="text">
<string>Publish signature data.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_116">
<property name="text">
@@ -6238,10 +6248,30 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_452">
<property name="text">
<string>Publish RAM usage.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="general_checkBox_publishRAM">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_437">
<property name="text">
<string>Compute RMSE when ground truth is available and publish it.</string>
<string>Compute RMSE when ground truth is available.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
@@ -6258,18 +6288,8 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_452">
<property name="text">
<string>Publish RAM usage.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="general_checkBox_publishRAM">
<item row="5" column="0">
<widget class="QCheckBox" name="general_checkBox_saveWMState">
<property name="text">
<string/>
</property>