mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Added script to reproduce results from loop closure detection paper. Added option to show Recall at 100% precision directly from rtabmap-console. Fixed retrieval not working on loop closure detection mode-only. Fixed showLogs.m error with Octave.
This commit is contained in:
@@ -151,6 +151,8 @@ public:
|
||||
|
||||
float getTimeThreshold() const {return _maxTimeAllowed;} // in ms
|
||||
void setTimeThreshold(float maxTimeAllowed); // in ms
|
||||
int getMemoryThreshold() const {return _maxMemoryAllowed;} // in nodes
|
||||
void setMemoryThreshold(int maxMemoryAllowed); // in nodes
|
||||
|
||||
void setInitialPose(const Transform & initialPose);
|
||||
int triggerNewMap();
|
||||
|
||||
@@ -2532,38 +2532,38 @@ bool Rtabmap::process(
|
||||
// insert them first to make sure they are loaded.
|
||||
reactivatedIds.insert(reactivatedIds.begin(), retrievalLocalIds.begin(), retrievalLocalIds.end());
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// RETRIEVAL 3/3 : Load signatures from the database
|
||||
//============================================================
|
||||
if(reactivatedIds.size())
|
||||
{
|
||||
// Not important if the loop closure hypothesis don't have all its neighbors loaded,
|
||||
// only a loop closure link is added...
|
||||
signaturesRetrieved = _memory->reactivateSignatures(
|
||||
reactivatedIds,
|
||||
_maxRetrieved+(unsigned int)retrievalLocalIds.size(), // add path retrieved
|
||||
timeRetrievalDbAccess);
|
||||
|
||||
ULOGGER_INFO("retrieval of %d (db time = %fs)", (int)signaturesRetrieved.size(), timeRetrievalDbAccess);
|
||||
|
||||
timeRetrievalDbAccess += timeGetNeighborsTimeDb + timeGetNeighborsSpaceDb;
|
||||
UINFO("total timeRetrievalDbAccess=%fs", timeRetrievalDbAccess);
|
||||
|
||||
// Immunize just retrieved signatures
|
||||
immunizedLocations.insert(signaturesRetrieved.begin(), signaturesRetrieved.end());
|
||||
|
||||
if(!signaturesRetrieved.empty() && !_globalScanMap.empty())
|
||||
{
|
||||
UWARN("Some signatures have been retrieved from memory management, clearing global scan map...");
|
||||
_globalScanMap.clear();
|
||||
_globalScanMapPoses.clear();
|
||||
}
|
||||
}
|
||||
timeReactivations = timer.ticks();
|
||||
ULOGGER_INFO("timeReactivations=%fs", timeReactivations);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// RETRIEVAL 3/3 : Load signatures from the database
|
||||
//============================================================
|
||||
if(reactivatedIds.size())
|
||||
{
|
||||
// Not important if the loop closure hypothesis don't have all its neighbors loaded,
|
||||
// only a loop closure link is added...
|
||||
signaturesRetrieved = _memory->reactivateSignatures(
|
||||
reactivatedIds,
|
||||
_maxRetrieved+(unsigned int)retrievalLocalIds.size(), // add path retrieved
|
||||
timeRetrievalDbAccess);
|
||||
|
||||
ULOGGER_INFO("retrieval of %d (db time = %fs)", (int)signaturesRetrieved.size(), timeRetrievalDbAccess);
|
||||
|
||||
timeRetrievalDbAccess += timeGetNeighborsTimeDb + timeGetNeighborsSpaceDb;
|
||||
UINFO("total timeRetrievalDbAccess=%fs", timeRetrievalDbAccess);
|
||||
|
||||
// Immunize just retrieved signatures
|
||||
immunizedLocations.insert(signaturesRetrieved.begin(), signaturesRetrieved.end());
|
||||
|
||||
if(!signaturesRetrieved.empty() && !_globalScanMap.empty())
|
||||
{
|
||||
UWARN("Some signatures have been retrieved from memory management, clearing global scan map...");
|
||||
_globalScanMap.clear();
|
||||
_globalScanMapPoses.clear();
|
||||
}
|
||||
}
|
||||
timeReactivations = timer.ticks();
|
||||
ULOGGER_INFO("timeReactivations=%fs", timeReactivations);
|
||||
|
||||
//============================================================
|
||||
// Proximity detections
|
||||
//============================================================
|
||||
@@ -4739,6 +4739,16 @@ void Rtabmap::setTimeThreshold(float maxTimeAllowed)
|
||||
ULOGGER_WARN("Time threshold set to %fms, it is not in seconds!", _maxTimeAllowed);
|
||||
}
|
||||
}
|
||||
void Rtabmap::setMemoryThreshold(int maxMemoryAllowed)
|
||||
{
|
||||
//must be positive, 0 mean inf memory allowed (no memory limit)
|
||||
_maxMemoryAllowed = maxMemoryAllowed;
|
||||
if(_maxMemoryAllowed < 0)
|
||||
{
|
||||
ULOGGER_WARN("maxMemoryAllowed < 0, then setting it to 0 (inf).");
|
||||
_maxMemoryAllowed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::setWorkingDirectory(std::string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user