fixed old occupancy grids not recreated when they were not saved previously in database

This commit is contained in:
matlabbe
2018-04-25 16:33:00 -04:00
parent ada469fec9
commit a89e0322d6
+6
View File
@@ -495,6 +495,12 @@ std::map<int, rtabmap::Transform> MapsManager::updateMapCaches(
"save them back in the database for next sessions. This warning is only shown once.",
data.id(), Parameters::kRGBDCreateOccupancyGrid().c_str());
}
if(occupancySavedInDB)
{
// if we are here, it is because we loaded a database with old nodes not having occupancy grid set
// try reload again
data = memory->getSignatureDataConst(iter->first, occupancyGrid_->isGridFromDepth(), !occupancyGrid_->isGridFromDepth(), false, false);
}
data.uncompressData(
occupancyGrid_->isGridFromDepth() && generateGrid?&rgb:0,
occupancyGrid_->isGridFromDepth() && generateGrid?&depth:0,