mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Fixed inf loop when all signatures are loaded in WM and if a signature has a -1 word
This commit is contained in:
@@ -239,8 +239,10 @@ void Memory::loadDataFromDb(bool postInitClosingEvents)
|
|||||||
|
|
||||||
// Now load the dictionary if we have a connection
|
// Now load the dictionary if we have a connection
|
||||||
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit("Loading dictionary..."));
|
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit("Loading dictionary..."));
|
||||||
|
UDEBUG("Loading dictionary...");
|
||||||
if(loadAllNodesInWM)
|
if(loadAllNodesInWM)
|
||||||
{
|
{
|
||||||
|
UDEBUG("load all referenced words in working memory");
|
||||||
// load all referenced words in working memory
|
// load all referenced words in working memory
|
||||||
std::set<int> wordIds;
|
std::set<int> wordIds;
|
||||||
const std::map<int, Signature *> & signatures = this->getSignatures();
|
const std::map<int, Signature *> & signatures = this->getSignatures();
|
||||||
@@ -248,7 +250,7 @@ void Memory::loadDataFromDb(bool postInitClosingEvents)
|
|||||||
{
|
{
|
||||||
const std::multimap<int, cv::KeyPoint> & words = i->second->getWords();
|
const std::multimap<int, cv::KeyPoint> & words = i->second->getWords();
|
||||||
std::list<int> keys = uUniqueKeys(words);
|
std::list<int> keys = uUniqueKeys(words);
|
||||||
for(std::list<int>::iterator iter=keys.begin(); iter!=keys.end();)
|
for(std::list<int>::iterator iter=keys.begin(); iter!=keys.end(); ++iter)
|
||||||
{
|
{
|
||||||
if(*iter > 0)
|
if(*iter > 0)
|
||||||
{
|
{
|
||||||
@@ -256,6 +258,8 @@ void Memory::loadDataFromDb(bool postInitClosingEvents)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UDEBUG("load words %d", (int)wordIds.size());
|
||||||
if(wordIds.size())
|
if(wordIds.size())
|
||||||
{
|
{
|
||||||
std::list<VisualWord*> words;
|
std::list<VisualWord*> words;
|
||||||
@@ -272,6 +276,7 @@ void Memory::loadDataFromDb(bool postInitClosingEvents)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
UDEBUG("load words");
|
||||||
// load the last dictionary
|
// load the last dictionary
|
||||||
_dbDriver->load(_vwd);
|
_dbDriver->load(_vwd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user