Skip to content

Commit c7da53a

Browse files
committed
Fixed regression when MapVisibility is not shown, poses are missing when exporting clouds #1625
1 parent 16c0d2f commit c7da53a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

guilib/include/rtabmap/gui/MapVisibilityWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class RTABMAP_GUI_EXPORT MapVisibilityWidget : public QWidget {
4444

4545
void setMap(const std::map<int, Transform> & poses, const std::map<int, bool> & mask);
4646
std::map<int, Transform> getVisiblePoses() const;
47+
bool isEmpty() const {return _poses.empty();}
4748

4849
void clear();
4950

guilib/src/MainWindow.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ void MainWindow::setupMainLayout(bool vertical)
755755

756756
std::map<int, Transform> MainWindow::currentVisiblePosesMap() const
757757
{
758-
return _ui->widget_mapVisibility->getVisiblePoses();
758+
return !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
759759
}
760760

761761
void MainWindow::setCloudViewer(rtabmap::CloudViewer * cloudViewer)
@@ -2891,6 +2891,9 @@ void MainWindow::updateMapCloud(
28912891
_ui->widget_mapVisibility->setMap(nodePoses, posesMask);
28922892
UDEBUG("Updated map visibility with %ld poses", nodePoses.size());
28932893
}
2894+
else {
2895+
_ui->widget_mapVisibility->clear();
2896+
}
28942897

28952898
if(groundTruths.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
28962899
{
@@ -8043,7 +8046,7 @@ void MainWindow::exportClouds()
80438046
return;
80448047
}
80458048

8046-
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
8049+
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
80478050

80488051
// Use ground truth poses if current clouds are using them
80498052
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
@@ -8080,7 +8083,7 @@ void MainWindow::viewClouds()
80808083
return;
80818084
}
80828085

8083-
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
8086+
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
80848087

80858088
// Use ground truth poses if current clouds are using them
80868089
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
@@ -8156,7 +8159,7 @@ void MainWindow::exportImages()
81568159
QMessageBox::warning(this, tr("Export images..."), tr("Cannot export images, the cache is empty!"));
81578160
return;
81588161
}
8159-
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
8162+
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
81608163

81618164
if(poses.empty())
81628165
{
@@ -8373,7 +8376,7 @@ void MainWindow::exportBundlerFormat()
83738376
return;
83748377
}
83758378

8376-
std::map<int, Transform> posesIn = _ui->widget_mapVisibility->getVisiblePoses();
8379+
std::map<int, Transform> posesIn = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
83778380

83788381
// Use ground truth poses if current clouds are using them
83798382
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())

0 commit comments

Comments
 (0)