mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Added c++ example usage
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@694 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -94,11 +94,14 @@ public:
|
||||
std::set<int> getStMem() const;
|
||||
std::map<int, int> getWeights() const;
|
||||
int getTotalMemSize() const;
|
||||
double getLastProcessTime() const {return _lastProcessTime;};
|
||||
|
||||
void setMaxTimeAllowed(float maxTimeAllowed); // in ms
|
||||
void setDataBufferSize(int size);
|
||||
void setWorkingDirectory(std::string path);
|
||||
|
||||
void deleteMemory();
|
||||
|
||||
void adjustLikelihood(std::map<int, float> & likelihood) const;
|
||||
std::pair<int, float> selectHypothesis(const std::map<int, float> & posterior,
|
||||
const std::map<int, float> & likelihood) const;
|
||||
@@ -141,6 +144,7 @@ private:
|
||||
int _retrievedId;
|
||||
float _lastLcHypothesisValue;
|
||||
int _lastLoopClosureId;
|
||||
double _lastProcessTime;
|
||||
|
||||
UMutex _stateMutex;
|
||||
std::stack<State> _state;
|
||||
|
||||
@@ -75,6 +75,7 @@ Rtabmap::Rtabmap() :
|
||||
_retrievedId(0),
|
||||
_lastLcHypothesisValue(0),
|
||||
_lastLoopClosureId(0),
|
||||
_lastProcessTime(0.0),
|
||||
_epipolarGeometry(0),
|
||||
_bayesFilter(0),
|
||||
_memory(0),
|
||||
@@ -517,6 +518,15 @@ void Rtabmap::mainLoop()
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::deleteMemory()
|
||||
{
|
||||
// Only if rtabmap's thread is not started...
|
||||
if(!this->isRunning())
|
||||
{
|
||||
this->resetMemory(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::resetMemory(bool dbOverwritten)
|
||||
{
|
||||
if(_memory)
|
||||
@@ -1146,6 +1156,7 @@ void Rtabmap::process()
|
||||
ULOGGER_INFO("Removing old signatures because time limit is reached %f>%f or memory is reached %d>%d...", totalTime*1000, _maxTimeAllowed, _memory->getWorkingMemSize(), _maxMemoryAllowed);
|
||||
signaturesRemoved = _memory->forget(immunizedLocations);
|
||||
}
|
||||
_lastProcessTime = totalTime;
|
||||
|
||||
timeRealTimeLimitReachedProcess = timer.ticks();
|
||||
ULOGGER_INFO("Time limit reached processing = %f...", timeRealTimeLimitReachedProcess);
|
||||
|
||||
Reference in New Issue
Block a user