Fixed saved grid map wrongly cleared when RGBD/OptimizeFromGraphEnd is true

This commit is contained in:
matlabbe
2018-08-02 17:07:48 -04:00
parent bc4b7a860e
commit a97be68897
3 changed files with 47 additions and 4 deletions
+2 -2
View File
@@ -502,8 +502,8 @@ void CoreWrapper::onInit()
cv::Mat map = rtabmap_.getMemory()->load2DMap(xMin, yMin, gridCellSize);
if(!map.empty())
{
NODELET_INFO("rtabmap: 2D occupancy grid map loaded.\n");
mapsManager_.set2DMap(map, xMin, yMin, gridCellSize, rtabmap_.getLocalOptimizedPoses());
NODELET_INFO("rtabmap: 2D occupancy grid map loaded (%dx%d).", map.cols, map.rows);
mapsManager_.set2DMap(map, xMin, yMin, gridCellSize, rtabmap_.getLocalOptimizedPoses(), rtabmap_.getMemory());
}
}