mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-07 18:47:48 +08:00
Added dummy dictionary function to speedup initialization when we dont need the dictionary fully loaded in memory.
This commit is contained in:
@@ -141,11 +141,12 @@ public:
|
||||
const std::map<int, Transform> & optimizedPoses,
|
||||
int maxGraphDepth) const;
|
||||
void convertToIntermediate(int locationId);
|
||||
void deleteLocation(int locationId, std::list<int> * deletedWords = 0);
|
||||
void deleteLocation(int locationId, std::list<int> * deletedWords = 0, bool keepLinkedInDb = false);
|
||||
void saveLocationData(int locationId);
|
||||
void removeLink(int idA, int idB);
|
||||
void removeRawData(int id, bool image = true, bool scan = true, bool userData = true, bool occupancyGrid = true);
|
||||
int reduceNode(int id, float maxDistance = 0.0f, bool keepLinkedInDb = false, int direction = 0);
|
||||
void setDummyDictionary(bool enabled);
|
||||
|
||||
//getters
|
||||
const std::map<int, double> & getWorkingMem() const {return _workingMem;}
|
||||
@@ -396,6 +397,8 @@ private:
|
||||
MarkerDetector * _markerDetector;
|
||||
|
||||
GlobalDescriptorExtractor * _globalDescriptorExtractor;
|
||||
|
||||
bool _dummyDictionary;
|
||||
};
|
||||
|
||||
} // namespace rtabmap
|
||||
|
||||
@@ -264,6 +264,7 @@ class RTABMAP_CORE_EXPORT Parameters
|
||||
RTABMAP_PARAM(Kp, NewWordsComparedTogether, bool, true, "When adding new words to dictionary, they are compared also with each other (to detect same words in the same signature).");
|
||||
RTABMAP_PARAM(Kp, FlannIndexSaved, bool, false, uFormat("Save FLANN index during localization session (when %s=false). The FLANN index will be saved to database after the first time localization mode is used, then on next sessions, the index is reloaded from the database instead of being rebuilt again. This can save significant loading time when the visual word dictionary is big (>1M words). Note that if the dictionary is modified (parameters or data), the index will be rebuilt and saved again on the next session. Ignored on initialization if %s is enabled.", kMemIncrementalMemory().c_str(), kMemInitWMWithAllNodes().c_str()).c_str());
|
||||
RTABMAP_PARAM(Kp, SerializeWithChecksum, bool, true, "On serialization of the FLANN index, compute checksum of the data used by the FLANN index. This adds a slight overhead on serialization/deserialization to make sure that the dictionary data correspond to same data used when the index was built.");
|
||||
RTABMAP_PARAM(Kp, AutoUpdate, bool, true, "Automatically update on any parameter changes affecting the structure of the dictionary. Otherwise, it is updated only when triggered externally (i.e., deferring initialization time).");
|
||||
RTABMAP_PARAM(Kp, SubPixWinSize, int, 3, "See cv::cornerSubPix().");
|
||||
RTABMAP_PARAM(Kp, SubPixIterations, int, 0, "See cv::cornerSubPix(). 0 disables sub pixel refining.");
|
||||
RTABMAP_PARAM(Kp, SubPixEps, double, 0.02, "See cv::cornerSubPix().");
|
||||
|
||||
@@ -229,6 +229,7 @@ public:
|
||||
bool addLink(const Link & link);
|
||||
cv::Mat getInformation(const cv::Mat & covariance) const;
|
||||
void addNodesToRepublish(const std::vector<int> & ids);
|
||||
void setDummyDictionary(bool enabled);
|
||||
|
||||
int getPathStatus() const {return _pathStatus;} // -1=failed 0=idle/executing 1=success
|
||||
void clearPath(int status); // -1=failed 0=idle/executing 1=success
|
||||
|
||||
@@ -108,6 +108,8 @@ public:
|
||||
void setIncrementalDictionary();
|
||||
void setFixedDictionary(const std::string & dictionaryPath);
|
||||
bool isModified() const;
|
||||
void setAutoUpdate(bool enabled) {_autoUpdate = enabled;} // Enable/Disable internal update when parameters change, update() has to be externally triggered if disabled.
|
||||
bool isAutoUpdateEnabled() const {return _autoUpdate;}
|
||||
|
||||
std::vector<unsigned char> serializeIndex() const;
|
||||
void deserializeIndex(const std::vector<unsigned char> & data);
|
||||
@@ -137,6 +139,7 @@ private:
|
||||
bool _incrementalFlann;
|
||||
float _rebalancingFactor;
|
||||
bool _byteToFloat;
|
||||
bool _autoUpdate;
|
||||
float _nndrRatio;
|
||||
std::string _dictionaryPath; // a pre-computed dictionary (.txt or .db)
|
||||
std::string _newDictionaryPath; // a pre-computed dictionary (.txt or .db)
|
||||
|
||||
Reference in New Issue
Block a user