mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Rtabmap::triggerNewMap() now does nothing in localization mode to make sure optimized map doesn't get regenerated
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user