Rtabmap::triggerNewMap() now does nothing in localization mode to make sure optimized map doesn't get regenerated

This commit is contained in:
matlabbe
2019-03-27 20:48:00 -04:00
parent 81313c32ee
commit 09ced82c9f
2 changed files with 11 additions and 1 deletions

View File

@@ -697,6 +697,13 @@ int Rtabmap::triggerNewMap()
int mapId = -1; int mapId = -1;
if(_memory) if(_memory)
{ {
if(!_memory->isIncremental())
{
UWARN("Memory is not incremental (%s=false), ignoring creating a new map as we "
"should be already processing new nodes in a new session.",
Parameters::kMemIncrementalMemory().c_str());
return mapId;
}
std::map<int, int> reducedIds; std::map<int, int> reducedIds;
mapId = _memory->incrementMapId(&reducedIds); mapId = _memory->incrementMapId(&reducedIds);
UINFO("New map triggered, new map = %d", mapId); UINFO("New map triggered, new map = %d", mapId);

View File

@@ -298,7 +298,10 @@ int main(int argc, char * argv[])
loopCount = 0; loopCount = 0;
totalFrames = 0; totalFrames = 0;
} }
rtabmap.triggerNewMap(); if(incrementalMemory)
{
rtabmap.triggerNewMap();
}
} }
UTimer t; UTimer t;
if(!rtabmap.process(data, info.odomPose, info.odomCovariance, info.odomVelocity, globalMapStats)) if(!rtabmap.process(data, info.odomPose, info.odomCovariance, info.odomVelocity, globalMapStats))