Fixed default nearest neighbor approach for the dictionary when the parameter is not set.

rtabmap_gui parameters panel can be opened without rtabmap parameters set on ROS (only GUI parameters can be changed).
Rtabmap: added getStatistics() method for convenience
Rtabmap/Memory: added deleteLastLocation() method to remove the last location in the STM.
 

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@779 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2013-01-28 18:13:56 +00:00
parent a4ccd6acd6
commit 1b7c995ea0
8 changed files with 134 additions and 55 deletions

View File

@@ -75,6 +75,7 @@ public:
bool incrementMarginOnLoop = false,
bool ignoreLoopIds = false,
double * dbAccessTime = 0) const;
void deleteLastLocation();
//getters
const std::set<int> & getWorkingMem() const {return _workingMem;}

View File

@@ -97,6 +97,7 @@ public:
std::multimap<int, cv::KeyPoint> getWords(int locationId);
std::map<int, int> getNeighbors(int nodeId, int margin, bool lookInLTM = false);
bool isInSTM(int locationId);
Statistics getStatistics();
void setTimeThreshold(float maxTimeAllowed); // in ms
@@ -106,6 +107,7 @@ public:
void dumpData();
void updateParameters(const ParametersMap & parameters);
void setWorkingDirectory(std::string path);
void deleteLastLocation();
void adjustLikelihood(std::map<int, float> & likelihood) const;
std::pair<int, float> selectHypothesis(const std::map<int, float> & posterior,
@@ -173,6 +175,8 @@ private:
std::list<std::string> _bufferedLogsF;
std::list<std::string> _bufferedLogsI;
Statistics statistics_;
std::string _wDir;
};

View File

@@ -149,16 +149,16 @@ private:
class RtabmapEvent : public UEvent
{
public:
RtabmapEvent(Statistics ** stats) :
RtabmapEvent(const Statistics & stats) :
UEvent(0),
_stats(*stats) {}
_stats(stats) {}
virtual ~RtabmapEvent() {if(_stats) delete _stats;}
const Statistics & getStats() const {return *_stats;}
virtual ~RtabmapEvent() {}
const Statistics & getStats() const {return _stats;}
virtual std::string getClassName() const {return std::string("RtabmapEvent");}
private:
Statistics * _stats;
Statistics _stats;
};
class RtabmapEventCmd : public UEvent