Skip to content

Commit

Permalink
Fixed map not showing in graphview
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Mar 27, 2024
1 parent 5d3af77 commit 279269f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion corelib/src/Optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Optimizer * Optimizer::create(Optimizer::Type type, const ParametersMap & parame
type = Optimizer::kTypeCeres;
}
}
if(!OptimizerGTSAM::available() && (type == Optimizer::kTypeGTSAM))
if(!OptimizerGTSAM::available() && type == Optimizer::kTypeGTSAM)
{
if(OptimizerG2O::available())
{
Expand Down
7 changes: 4 additions & 3 deletions guilib/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3429,7 +3429,8 @@ void MainWindow::updateMapCloud(
}
}
cv::Mat map8U;
if(_ui->graphicsView_graphView->isVisible() && _preferencesDialog->getGridMapShown())
if((_ui->graphicsView_graphView->isVisible() && _ui->graphicsView_graphView->isGridMapVisible()) ||
(_cloudViewer->isVisible() && _preferencesDialog->getGridMapShown()))
{
float xMin, yMin;
float resolution = _occupancyGrid->getCellSize();
Expand Down Expand Up @@ -3457,12 +3458,12 @@ void MainWindow::updateMapCloud(
//convert to gray scaled map
map8U = util3d::convertMap2Image8U(map8S);

if(_preferencesDialog->getGridMapShown())
if(_cloudViewer->isVisible() && _preferencesDialog->getGridMapShown())
{
float opacity = _preferencesDialog->getGridMapOpacity();
_cloudViewer->addOccupancyGridMap(map8U, resolution, xMin, yMin, opacity);
}
if(_ui->graphicsView_graphView->isVisible())
if(_ui->graphicsView_graphView->isVisible() && _ui->graphicsView_graphView->isGridMapVisible())
{
_ui->graphicsView_graphView->updateMap(map8U, resolution, xMin, yMin);
}
Expand Down

0 comments on commit 279269f

Please sign in to comment.