Fixed occupancy grid not reconstructed if it was not saved in previous run

This commit is contained in:
matlabbe
2018-04-30 13:06:25 -04:00
parent a92748167d
commit 6c10d9fecf
3 changed files with 8 additions and 5 deletions
+2
View File
@@ -478,6 +478,7 @@ 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());
}
}
@@ -647,6 +648,7 @@ CoreWrapper::~CoreWrapper()
cv::Mat pixels = mapsManager_.getGridMap(xMin, yMin, gridCellSize);
if(!pixels.empty())
{
printf("rtabmap: 2D occupancy grid map saved.\n");
rtabmap_.getMemory()->save2DMap(pixels, xMin, yMin, gridCellSize);
}
}