This is causing the issue, updated pose is not found in node after tag detection and maps get cleared,
https://github.com/introlab/rtabmap/blob/master/corelib/src/GlobalMap.cpp#L131I thought the tags were not added as nodes, just kept as links which get destroyed once seen and optimized. If i comment this out, it works and the map does not revert back, does a new condition needs to be added for this
if graphChanged && tag_detections ?
if(graphOptimized || graphChanged)
{
// clear all but keep cache
//clear();
}