mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed issue 10
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1544 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -755,7 +755,7 @@ std::map<int, int> Memory::getNeighborsId(int signatureId,
|
||||
|
||||
for(std::list<int>::iterator jter = curentMarginList.begin(); jter!=curentMarginList.end(); ++jter)
|
||||
{
|
||||
if(ids.insert(std::pair<int, int>(*jter, m)).second)
|
||||
if(ids.find(*jter) == ids.end())
|
||||
{
|
||||
//UDEBUG("Added %d with margin %d", *jter, m);
|
||||
// Look up in STM/WM if all ids are here, if not... load them from the database
|
||||
@@ -768,6 +768,8 @@ std::map<int, int> Memory::getNeighborsId(int signatureId,
|
||||
const std::map<int, Transform> * childLoopClosureIds = &tmpChildLoopClosureIds;
|
||||
if(s)
|
||||
{
|
||||
ids.insert(std::pair<int, int>(*jter, m));
|
||||
|
||||
neighborIds = &s->getNeighbors();
|
||||
|
||||
if(!ignoreLoopIds)
|
||||
@@ -778,6 +780,8 @@ std::map<int, int> Memory::getNeighborsId(int signatureId,
|
||||
}
|
||||
else if(maxCheckedInDatabase == -1 || (maxCheckedInDatabase > 0 && _dbDriver && nbLoadedFromDb < maxCheckedInDatabase))
|
||||
{
|
||||
ids.insert(std::pair<int, int>(*jter, m));
|
||||
|
||||
UTimer timer;
|
||||
_dbDriver->loadNeighbors(*jter, tmpNeighborIds);
|
||||
if(!ignoreLoopIds)
|
||||
|
||||
@@ -1962,8 +1962,6 @@ void Rtabmap::optimizeCurrentMap(
|
||||
if(!_optimizeFromGraphEnd && ids.size() > 1)
|
||||
{
|
||||
UTimer timer;
|
||||
UDEBUG("Optimize from the first location (%d) instead of the last (%d) "
|
||||
"in the local graph. Recomputing neighbors depth...");
|
||||
|
||||
int first = ids.begin()->first;
|
||||
ids = _memory->getNeighborsId(first, 0, lookInDatabase?-1:0, true);
|
||||
|
||||
Reference in New Issue
Block a user