mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +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 preUpdate();
|
||||||
void addSignatureToStm(Signature * signature);
|
void addSignatureToStm(Signature * signature);
|
||||||
void clear();
|
void clear();
|
||||||
void moveToTrash(Signature * s);
|
void moveToTrash(Signature * s, bool saveToDatabase = true);
|
||||||
|
|
||||||
void addSignatureToWm(Signature * signature);
|
void addSignatureToWm(Signature * signature);
|
||||||
Signature * _getSignature(int id) const;
|
Signature * _getSignature(int id) const;
|
||||||
|
|||||||
@@ -1336,7 +1336,7 @@ std::list<Signature *> Memory::getRemovableSignatures(int count, const std::set<
|
|||||||
return removableSignatures;
|
return removableSignatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Memory::moveToTrash(Signature * s)
|
void Memory::moveToTrash(Signature * s, bool saveToDatabase)
|
||||||
{
|
{
|
||||||
UINFO("id=%d", s?s->id():0);
|
UINFO("id=%d", s?s->id():0);
|
||||||
if(s)
|
if(s)
|
||||||
@@ -1369,7 +1369,8 @@ void Memory::moveToTrash(Signature * s)
|
|||||||
s->removeNeighbors();
|
s->removeNeighbors();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _dbDriver &&
|
if( saveToDatabase &&
|
||||||
|
_dbDriver &&
|
||||||
s->id()>0)
|
s->id()>0)
|
||||||
{
|
{
|
||||||
_dbDriver->asyncSave(s);
|
_dbDriver->asyncSave(s);
|
||||||
@@ -1390,7 +1391,7 @@ const Signature * Memory::getLastSignature() const
|
|||||||
void Memory::deleteLastLocation()
|
void Memory::deleteLastLocation()
|
||||||
{
|
{
|
||||||
Signature * lastSignature = _lastSignature;
|
Signature * lastSignature = _lastSignature;
|
||||||
if(_lastSignature)
|
if(lastSignature)
|
||||||
{
|
{
|
||||||
UDEBUG("deleting last location %d", lastSignature->id());
|
UDEBUG("deleting last location %d", lastSignature->id());
|
||||||
const std::set<int> & neighbors = lastSignature->getNeighbors();
|
const std::set<int> & neighbors = lastSignature->getNeighbors();
|
||||||
@@ -1416,7 +1417,7 @@ void Memory::deleteLastLocation()
|
|||||||
}
|
}
|
||||||
lastSignature->setWeight(0);
|
lastSignature->setWeight(0);
|
||||||
|
|
||||||
this->moveToTrash(lastSignature);
|
this->moveToTrash(lastSignature, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user