mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Fixed cloud -1 not found on export, fixed cloud visibility doing nothing to cloud -1
This commit is contained in:
@@ -3198,45 +3198,44 @@ Transform MainWindow::alignPosesToGroundTruth(
|
|||||||
|
|
||||||
void MainWindow::updateNodeVisibility(int nodeId, bool visible)
|
void MainWindow::updateNodeVisibility(int nodeId, bool visible)
|
||||||
{
|
{
|
||||||
if(_currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
UINFO("Update visibility %d", nodeId);
|
||||||
|
QMap<std::string, Transform> viewerClouds = _cloudViewer->getAddedClouds();
|
||||||
|
if(_preferencesDialog->isCloudsShown(0))
|
||||||
{
|
{
|
||||||
QMap<std::string, Transform> viewerClouds = _cloudViewer->getAddedClouds();
|
std::string cloudName = uFormat("cloud%d", nodeId);
|
||||||
if(_preferencesDialog->isCloudsShown(0))
|
if(visible && !viewerClouds.contains(cloudName) && _cachedSignatures.contains(nodeId) && _currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
||||||
{
|
{
|
||||||
std::string cloudName = uFormat("cloud%d", nodeId);
|
createAndAddCloudToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
||||||
if(visible && !viewerClouds.contains(cloudName) && _cachedSignatures.contains(nodeId))
|
|
||||||
{
|
|
||||||
createAndAddCloudToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
|
||||||
}
|
|
||||||
else if(viewerClouds.contains(cloudName))
|
|
||||||
{
|
|
||||||
if(visible)
|
|
||||||
{
|
|
||||||
//make sure the transformation was done
|
|
||||||
_cloudViewer->updateCloudPose(cloudName, _currentPosesMap.find(nodeId)->second);
|
|
||||||
}
|
|
||||||
_cloudViewer->setCloudVisibility(cloudName, visible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if(viewerClouds.contains(cloudName))
|
||||||
if(_preferencesDialog->isScansShown(0))
|
|
||||||
{
|
{
|
||||||
std::string scanName = uFormat("scan%d", nodeId);
|
if(visible && _currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
||||||
if(visible && !viewerClouds.contains(scanName) && _cachedSignatures.contains(nodeId))
|
|
||||||
{
|
{
|
||||||
createAndAddScanToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
//make sure the transformation was done
|
||||||
}
|
_cloudViewer->updateCloudPose(cloudName, _currentPosesMap.find(nodeId)->second);
|
||||||
else if(viewerClouds.contains(scanName))
|
|
||||||
{
|
|
||||||
if(visible)
|
|
||||||
{
|
|
||||||
//make sure the transformation was done
|
|
||||||
_cloudViewer->updateCloudPose(scanName, _currentPosesMap.find(nodeId)->second);
|
|
||||||
}
|
|
||||||
_cloudViewer->setCloudVisibility(scanName, visible);
|
|
||||||
}
|
}
|
||||||
|
_cloudViewer->setCloudVisibility(cloudName, visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_preferencesDialog->isScansShown(0))
|
||||||
|
{
|
||||||
|
std::string scanName = uFormat("scan%d", nodeId);
|
||||||
|
if(visible && !viewerClouds.contains(scanName) && _cachedSignatures.contains(nodeId) && _currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
||||||
|
{
|
||||||
|
createAndAddScanToMap(nodeId, _currentPosesMap.find(nodeId)->second, uValue(_currentMapIds, nodeId, -1));
|
||||||
|
}
|
||||||
|
else if(viewerClouds.contains(scanName))
|
||||||
|
{
|
||||||
|
if(visible && _currentPosesMap.find(nodeId) != _currentPosesMap.end())
|
||||||
|
{
|
||||||
|
//make sure the transformation was done
|
||||||
|
_cloudViewer->updateCloudPose(scanName, _currentPosesMap.find(nodeId)->second);
|
||||||
|
}
|
||||||
|
_cloudViewer->setCloudVisibility(scanName, visible);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_cloudViewer->update();
|
_cloudViewer->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5909,8 +5908,6 @@ void MainWindow::exportGridMap()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<int, Transform> poses = _ui->widget_mapVisibility->getVisiblePoses();
|
|
||||||
|
|
||||||
// create the map
|
// create the map
|
||||||
float xMin=0.0f, yMin=0.0f;
|
float xMin=0.0f, yMin=0.0f;
|
||||||
cv::Mat pixels;
|
cv::Mat pixels;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ std::map<int, Transform> MapVisibilityWidget::getVisiblePoses() const
|
|||||||
std::map<int, Transform> poses;
|
std::map<int, Transform> poses;
|
||||||
for(std::map<int, Transform>::const_iterator iter=_poses.begin(); iter!=_poses.end(); ++iter)
|
for(std::map<int, Transform>::const_iterator iter=_poses.begin(); iter!=_poses.end(); ++iter)
|
||||||
{
|
{
|
||||||
if(_mask.at(iter->first))
|
if(_mask.at(iter->first) && iter->first > 0)
|
||||||
{
|
{
|
||||||
poses.insert(*iter);
|
poses.insert(*iter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user