rtabmap: localization mode (run under fixed memory and fixed dictionary), optional retrieving of the last extracted words when calling rtabmap.process() (useful when in localization mode where the last location is deleted after the rtabmap process)

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@882 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2013-06-10 18:54:11 +00:00
parent 30ab6dca0e
commit 6c656e7c57
6 changed files with 56 additions and 23 deletions
+12 -7
View File
@@ -394,9 +394,9 @@ int Rtabmap::getRetrievedId() const
int Rtabmap::getLastLocationId() const
{
int id = 0;
if(_memory && _memory->getLastSignature())
if(_memory)
{
id = _memory->getLastSignature()->id();
id = _memory->getLastSignatureId();
}
return id;
}
@@ -454,7 +454,7 @@ int Rtabmap::getTotalMemSize() const
{
if(_memory)
{
const Signature * s =_memory->getLastSignature();
const Signature * s =_memory->getLastWorkingSignature();
if(s)
{
return s->id();
@@ -557,7 +557,7 @@ void Rtabmap::resetMemory(bool dbOverwritten)
//============================================================
// MAIN LOOP
//============================================================
void Rtabmap::process(const Image & image)
void Rtabmap::process(const Image & image, std::multimap<int, cv::KeyPoint> * words)
{
UDEBUG("");
@@ -630,7 +630,7 @@ void Rtabmap::process(const Image & image)
{
return;
}
signature = _memory->getLastSignature();
signature = _memory->getLastWorkingSignature();
if(!signature)
{
UFATAL("Not supposed to be here...last signature is null?!?");
@@ -640,6 +640,11 @@ void Rtabmap::process(const Image & image)
timeMemoryUpdate = timer.ticks();
ULOGGER_INFO("timeMemoryUpdate=%fs", timeMemoryUpdate);
if(words)
{
*words = signature->getWords();
}
//============================================================
// Bayes filter update
//============================================================
@@ -1229,10 +1234,10 @@ void Rtabmap::rejectLastLoopClosure()
}
}
void Rtabmap::process(const cv::Mat & image, int id)
void Rtabmap::process(const cv::Mat & image, int id, std::multimap<int, cv::KeyPoint> * words)
{
this->process(Image(image, id));
this->process(Image(image, id), words);
}
void Rtabmap::dumpData() const