mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
Fixed not working "Insert data in GUI cache" when disabled
This commit is contained in:
@@ -56,6 +56,15 @@ void ExportCloudsDialog::setOkButton()
|
|||||||
_ui->checkBox_binary->setVisible(false);
|
_ui->checkBox_binary->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExportCloudsDialog::enableRegeneration(bool enabled)
|
||||||
|
{
|
||||||
|
if(!enabled)
|
||||||
|
{
|
||||||
|
_ui->groupBox_regenerate->setChecked(false);
|
||||||
|
}
|
||||||
|
_ui->groupBox_regenerate->setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
bool ExportCloudsDialog::getAssemble() const
|
bool ExportCloudsDialog::getAssemble() const
|
||||||
{
|
{
|
||||||
return _ui->groupBox_assemble->isChecked();
|
return _ui->groupBox_assemble->isChecked();
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
|
|
||||||
void setSaveButton();
|
void setSaveButton();
|
||||||
void setOkButton();
|
void setOkButton();
|
||||||
|
void enableRegeneration(bool enabled);
|
||||||
|
|
||||||
bool getAssemble() const;
|
bool getAssemble() const;
|
||||||
double getAssembleVoxel() const;
|
double getAssembleVoxel() const;
|
||||||
|
|||||||
+68
-51
@@ -1060,6 +1060,11 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
|||||||
this->captureScreen();
|
this->captureScreen();
|
||||||
}
|
}
|
||||||
_processingStatistics = false;
|
_processingStatistics = false;
|
||||||
|
|
||||||
|
if(!_preferencesDialog->isImagesKept())
|
||||||
|
{
|
||||||
|
_cachedSignatures.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateMapCloud(
|
void MainWindow::updateMapCloud(
|
||||||
@@ -1101,7 +1106,7 @@ void MainWindow::updateMapCloud(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_ui->actionPost_processing->setEnabled(_currentPosesMap.size() >= 2 && _currentLinksMap.size() >= 1);
|
_ui->actionPost_processing->setEnabled(_cachedSignatures.size() >= 2 && _currentPosesMap.size() >= 2 && _currentLinksMap.size() >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter duplicated poses
|
// filter duplicated poses
|
||||||
@@ -1518,10 +1523,10 @@ void MainWindow::updateNodeVisibility(int nodeId, bool visible)
|
|||||||
if(_currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
if(_currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
||||||
{
|
{
|
||||||
QMap<std::string, Transform> viewerClouds = _ui->widget_cloudViewer->getAddedClouds();
|
QMap<std::string, Transform> viewerClouds = _ui->widget_cloudViewer->getAddedClouds();
|
||||||
if(_preferencesDialog->isCloudsShown(0) && _cachedSignatures.contains(nodeId))
|
if(_preferencesDialog->isCloudsShown(0))
|
||||||
{
|
{
|
||||||
std::string cloudName = uFormat("cloud%d", nodeId);
|
std::string cloudName = uFormat("cloud%d", nodeId);
|
||||||
if(visible && !viewerClouds.contains(cloudName))
|
if(visible && !viewerClouds.contains(cloudName) && _cachedSignatures.contains(nodeId))
|
||||||
{
|
{
|
||||||
createAndAddCloudToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
createAndAddCloudToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
||||||
}
|
}
|
||||||
@@ -1536,10 +1541,10 @@ void MainWindow::updateNodeVisibility(int nodeId, bool visible)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_preferencesDialog->isScansShown(0) && _cachedSignatures.contains(nodeId))
|
if(_preferencesDialog->isScansShown(0))
|
||||||
{
|
{
|
||||||
std::string scanName = uFormat("scan%d", nodeId);
|
std::string scanName = uFormat("scan%d", nodeId);
|
||||||
if(visible && !viewerClouds.contains(scanName))
|
if(visible && !viewerClouds.contains(scanName) && _cachedSignatures.contains(nodeId))
|
||||||
{
|
{
|
||||||
createAndAddScanToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
createAndAddScanToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
||||||
}
|
}
|
||||||
@@ -1714,6 +1719,11 @@ void MainWindow::processRtabmapEvent3DMap(const rtabmap::RtabmapEvent3DMap & eve
|
|||||||
}
|
}
|
||||||
|
|
||||||
_initProgressDialog->appendText(tr("%1 locations are updated to/inserted in the cache.").arg(event.getPoses().size()));
|
_initProgressDialog->appendText(tr("%1 locations are updated to/inserted in the cache.").arg(event.getPoses().size()));
|
||||||
|
|
||||||
|
if(!_preferencesDialog->isImagesKept())
|
||||||
|
{
|
||||||
|
_cachedSignatures.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_initProgressDialog->setValue(_initProgressDialog->maximumSteps());
|
_initProgressDialog->setValue(_initProgressDialog->maximumSteps());
|
||||||
}
|
}
|
||||||
@@ -2711,6 +2721,11 @@ void MainWindow::generateTOROMap()
|
|||||||
|
|
||||||
void MainWindow::postProcessing()
|
void MainWindow::postProcessing()
|
||||||
{
|
{
|
||||||
|
if(_cachedSignatures.size() == 0)
|
||||||
|
{
|
||||||
|
UERROR("Signatures must be cached in the GUI to post processing.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(_postProcessingDialog->exec() != QDialog::Accepted)
|
if(_postProcessingDialog->exec() != QDialog::Accepted)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -3901,6 +3916,7 @@ bool MainWindow::getExportedClouds(
|
|||||||
{
|
{
|
||||||
_exportDialog->setOkButton();
|
_exportDialog->setOkButton();
|
||||||
}
|
}
|
||||||
|
_exportDialog->enableRegeneration(_preferencesDialog->isImagesKept());
|
||||||
if(_exportDialog->exec() == QDialog::Accepted)
|
if(_exportDialog->exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
||||||
@@ -4453,14 +4469,15 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr MainWindow::getAssembledCloud(
|
|||||||
bool inserted = false;
|
bool inserted = false;
|
||||||
if(!iter->second.isNull())
|
if(!iter->second.isNull())
|
||||||
{
|
{
|
||||||
if(_cachedSignatures.contains(iter->first))
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
|
if(regenerateClouds)
|
||||||
{
|
{
|
||||||
const Signature & s = _cachedSignatures.find(iter->first).value();
|
if(_cachedSignatures.contains(iter->first))
|
||||||
cv::Mat image, depth;
|
|
||||||
s.uncompressDataConst(&image, &depth, 0);
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
|
||||||
if(regenerateClouds)
|
|
||||||
{
|
{
|
||||||
|
const Signature & s = _cachedSignatures.find(iter->first).value();
|
||||||
|
cv::Mat image, depth;
|
||||||
|
s.uncompressDataConst(&image, &depth, 0);
|
||||||
|
|
||||||
cloud = createCloud(iter->first,
|
cloud = createCloud(iter->first,
|
||||||
image,
|
image,
|
||||||
depth,
|
depth,
|
||||||
@@ -4474,22 +4491,22 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr MainWindow::getAssembledCloud(
|
|||||||
regenerateDecimation,
|
regenerateDecimation,
|
||||||
regenerateMaxDepth);
|
regenerateMaxDepth);
|
||||||
}
|
}
|
||||||
else if(uContains(_createdClouds, iter->first))
|
else
|
||||||
{
|
{
|
||||||
cloud = util3d::transformPointCloud<pcl::PointXYZRGB>(_createdClouds.at(iter->first), iter->second);
|
UWARN("Cloud %d not found in cache!", iter->first);
|
||||||
}
|
|
||||||
|
|
||||||
if(cloud->size())
|
|
||||||
{
|
|
||||||
*assembledCloud += *cloud;
|
|
||||||
|
|
||||||
inserted = true;
|
|
||||||
++count;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(uContains(_createdClouds, iter->first))
|
||||||
{
|
{
|
||||||
UERROR("Cloud %d not found?!?", iter->first);
|
cloud = util3d::transformPointCloud<pcl::PointXYZRGB>(_createdClouds.at(iter->first), iter->second);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cloud->size())
|
||||||
|
{
|
||||||
|
*assembledCloud += *cloud;
|
||||||
|
|
||||||
|
inserted = true;
|
||||||
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -4539,41 +4556,41 @@ std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr > MainWindow::getClouds(
|
|||||||
bool inserted = false;
|
bool inserted = false;
|
||||||
if(!iter->second.isNull())
|
if(!iter->second.isNull())
|
||||||
{
|
{
|
||||||
if(_cachedSignatures.contains(iter->first))
|
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
|
||||||
|
if(regenerateClouds)
|
||||||
{
|
{
|
||||||
const Signature & s = _cachedSignatures.find(iter->first).value();
|
if(_cachedSignatures.contains(iter->first))
|
||||||
cv::Mat image, depth;
|
|
||||||
s.uncompressDataConst(&image, &depth, 0);
|
|
||||||
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud;
|
|
||||||
if(regenerateClouds)
|
|
||||||
{
|
{
|
||||||
cloud = createCloud(iter->first,
|
const Signature & s = _cachedSignatures.find(iter->first).value();
|
||||||
image,
|
cv::Mat image, depth;
|
||||||
depth,
|
s.uncompressDataConst(&image, &depth, 0);
|
||||||
s.getDepthFx(),
|
cloud = createCloud(iter->first,
|
||||||
s.getDepthFy(),
|
image,
|
||||||
s.getDepthCx(),
|
depth,
|
||||||
s.getDepthCy(),
|
s.getDepthFx(),
|
||||||
s.getLocalTransform(),
|
s.getDepthFy(),
|
||||||
Transform::getIdentity(),
|
s.getDepthCx(),
|
||||||
regenerateVoxelSize,
|
s.getDepthCy(),
|
||||||
regenerateDecimation,
|
s.getLocalTransform(),
|
||||||
regenerateMaxDepth);
|
Transform::getIdentity(),
|
||||||
|
regenerateVoxelSize,
|
||||||
|
regenerateDecimation,
|
||||||
|
regenerateMaxDepth);
|
||||||
}
|
}
|
||||||
else if(uContains(_createdClouds, iter->first))
|
else
|
||||||
{
|
{
|
||||||
cloud = _createdClouds.at(iter->first);
|
UERROR("Cloud %d not found in cache!", iter->first);
|
||||||
}
|
|
||||||
|
|
||||||
if(cloud->size())
|
|
||||||
{
|
|
||||||
clouds.insert(std::make_pair(iter->first, cloud));
|
|
||||||
inserted = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(uContains(_createdClouds, iter->first))
|
||||||
{
|
{
|
||||||
UERROR("Cloud %d not found?!?", iter->first);
|
cloud = _createdClouds.at(iter->first);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cloud->size())
|
||||||
|
{
|
||||||
|
clouds.insert(std::make_pair(iter->first, cloud));
|
||||||
|
inserted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user