mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Database update (version 0.8.5): added Node.stamp and Node.label fields
Added labeling mechanism of nodes (by default the first node of a map is tagged "map#")
This commit is contained in:
@@ -483,6 +483,41 @@ void DBDriver::getInvertedIndexNi(int signatureId, int & ni) const
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
|
||||
void DBDriver::getNodeIdByLabel(const std::string & label, int & id) const
|
||||
{
|
||||
if(!label.empty())
|
||||
{
|
||||
int idFound = 0;
|
||||
// look in the trash
|
||||
_trashesMutex.lock();
|
||||
for(std::map<int, Signature*>::const_iterator sIter = _trashSignatures.begin(); sIter!=_trashSignatures.end(); ++sIter)
|
||||
{
|
||||
if(sIter->second->getLabel().compare(label) == 0)
|
||||
{
|
||||
idFound = sIter->first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_trashesMutex.unlock();
|
||||
|
||||
// then look in the database
|
||||
if(idFound == 0)
|
||||
{
|
||||
_dbSafeAccessMutex.lock();
|
||||
this->getNodeIdByLabelQuery(label, id);
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
else
|
||||
{
|
||||
id = idFound;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UWARN("Can't search with an empty label!");
|
||||
}
|
||||
}
|
||||
|
||||
void DBDriver::addStatisticsAfterRun(int stMemSize, int lastSignAdded, int processMemUsed, int databaseMemUsed, int dictionarySize) const
|
||||
{
|
||||
ULOGGER_DEBUG("");
|
||||
|
||||
Reference in New Issue
Block a user