mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-11 22:10:21 +08:00
Fixed regression when MapVisibility is not shown, poses are missing when exporting clouds #1625
This commit is contained in:
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
void setMap(const std::map<int, Transform> & poses, const std::map<int, bool> & mask);
|
||||
std::map<int, Transform> getVisiblePoses() const;
|
||||
bool isEmpty() const {return _poses.empty();}
|
||||
|
||||
void clear();
|
||||
|
||||
|
||||
@@ -755,7 +755,7 @@ void MainWindow::setupMainLayout(bool vertical)
|
||||
|
||||
std::map<int, Transform> MainWindow::currentVisiblePosesMap() const
|
||||
{
|
||||
return _ui->widget_mapVisibility->getVisiblePoses();
|
||||
return !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
|
||||
}
|
||||
|
||||
void MainWindow::setCloudViewer(rtabmap::CloudViewer * cloudViewer)
|
||||
@@ -2891,6 +2891,9 @@ void MainWindow::updateMapCloud(
|
||||
_ui->widget_mapVisibility->setMap(nodePoses, posesMask);
|
||||
UDEBUG("Updated map visibility with %ld poses", nodePoses.size());
|
||||
}
|
||||
else {
|
||||
_ui->widget_mapVisibility->clear();
|
||||
}
|
||||
|
||||
if(groundTruths.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
|
||||
{
|
||||
@@ -8043,7 +8046,7 @@ void MainWindow::exportClouds()
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
||||
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
|
||||
|
||||
// Use ground truth poses if current clouds are using them
|
||||
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
|
||||
@@ -8080,7 +8083,7 @@ void MainWindow::viewClouds()
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
||||
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
|
||||
|
||||
// Use ground truth poses if current clouds are using them
|
||||
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
|
||||
@@ -8156,7 +8159,7 @@ void MainWindow::exportImages()
|
||||
QMessageBox::warning(this, tr("Export images..."), tr("Cannot export images, the cache is empty!"));
|
||||
return;
|
||||
}
|
||||
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
||||
std::map<int, Transform> poses = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
|
||||
|
||||
if(poses.empty())
|
||||
{
|
||||
@@ -8373,7 +8376,7 @@ void MainWindow::exportBundlerFormat()
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<int, Transform> posesIn = _ui->widget_mapVisibility->getVisiblePoses();
|
||||
std::map<int, Transform> posesIn = !_ui->widget_mapVisibility->isEmpty()?_ui->widget_mapVisibility->getVisiblePoses():_currentPosesMap;
|
||||
|
||||
// Use ground truth poses if current clouds are using them
|
||||
if(_currentGTPosesMap.size() && _ui->actionAnchor_clouds_to_ground_truth->isChecked())
|
||||
|
||||
Reference in New Issue
Block a user