mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
rtabmap: deleteLastLocation now delete the location instead of saving it in database
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@831 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -130,7 +130,7 @@ protected:
|
||||
void preUpdate();
|
||||
void addSignatureToStm(Signature * signature);
|
||||
void clear();
|
||||
void moveToTrash(Signature * s);
|
||||
void moveToTrash(Signature * s, bool saveToDatabase = true);
|
||||
|
||||
void addSignatureToWm(Signature * signature);
|
||||
Signature * _getSignature(int id) const;
|
||||
|
||||
@@ -1336,7 +1336,7 @@ std::list<Signature *> Memory::getRemovableSignatures(int count, const std::set<
|
||||
return removableSignatures;
|
||||
}
|
||||
|
||||
void Memory::moveToTrash(Signature * s)
|
||||
void Memory::moveToTrash(Signature * s, bool saveToDatabase)
|
||||
{
|
||||
UINFO("id=%d", s?s->id():0);
|
||||
if(s)
|
||||
@@ -1369,7 +1369,8 @@ void Memory::moveToTrash(Signature * s)
|
||||
s->removeNeighbors();
|
||||
}
|
||||
|
||||
if( _dbDriver &&
|
||||
if( saveToDatabase &&
|
||||
_dbDriver &&
|
||||
s->id()>0)
|
||||
{
|
||||
_dbDriver->asyncSave(s);
|
||||
@@ -1390,7 +1391,7 @@ const Signature * Memory::getLastSignature() const
|
||||
void Memory::deleteLastLocation()
|
||||
{
|
||||
Signature * lastSignature = _lastSignature;
|
||||
if(_lastSignature)
|
||||
if(lastSignature)
|
||||
{
|
||||
UDEBUG("deleting last location %d", lastSignature->id());
|
||||
const std::set<int> & neighbors = lastSignature->getNeighbors();
|
||||
@@ -1416,7 +1417,7 @@ void Memory::deleteLastLocation()
|
||||
}
|
||||
lastSignature->setWeight(0);
|
||||
|
||||
this->moveToTrash(lastSignature);
|
||||
this->moveToTrash(lastSignature, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user