mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Reduce graph: added option to remove orphan nodes from WM after reduction (#1735)
* Reduce graph: remove orphan nodes from WM after reduction * fixed eror * ignore ids< 0 * add warning and cleanup only when option is used * updated feedback * Abort --sync_wm_and_opt_graph if a lot more WM nodes have to be transferred. * typo * refactored... completly * fixed optimized graph cleared * updated option description * updated comment * Added dummy dictionary function to speedup initialization when we dont need the dictionary fully loaded in memory. * Fixed nodes weight not modified in db when deleted * Removed AutoUpdate parameter, not needed * Fixed dummy dictionary usage for detectMoreLoopClosures. Added checks to disable graph reduction when intermediate nodes are detected. * updated log
This commit is contained in:
@@ -249,9 +249,15 @@ int main(int argc, char * argv[])
|
||||
UTimer timer;
|
||||
ParametersMap originalParameters = parameters;
|
||||
uInsert(parameters, inputParams);
|
||||
|
||||
// This avoids to load original descriptors in the dictionary
|
||||
// to save RAM and intialization time (we don't need the dictionary for this tool)
|
||||
rtabmap.setDummyDictionary(true); // should be set before Rtabmap::init()
|
||||
|
||||
rtabmap.init(parameters, dbPath);
|
||||
printf("Initialization... done! (%f sec)\n", timer.ticks());
|
||||
|
||||
// detectMoreLoopClosures would clear the optimized map if loop closures are detected
|
||||
float xMin, yMin, cellSize;
|
||||
bool haveOptimizedMap = !rtabmap.getMemory()->load2DMap(xMin, yMin, cellSize).empty();
|
||||
|
||||
@@ -311,7 +317,7 @@ int main(int argc, char * argv[])
|
||||
// Restore original parameters before saving back the database
|
||||
rtabmap.parseParameters(originalParameters);
|
||||
|
||||
rtabmap.close();
|
||||
rtabmap.close(detected>0);
|
||||
|
||||
return 0;
|
||||
return detected>=0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user