mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 18:17:47 +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:
+18
-1
@@ -180,7 +180,8 @@ Rtabmap::Rtabmap() :
|
||||
_pathGoalIndex(0),
|
||||
_pathTransformToGoal(Transform::getIdentity()),
|
||||
_pathStuckCount(0),
|
||||
_pathStuckDistance(0.0f)
|
||||
_pathStuckDistance(0.0f),
|
||||
_dummyDictionary(false)
|
||||
#ifdef RTABMAP_PYTHON
|
||||
,_python(new PythonInterface())
|
||||
#endif
|
||||
@@ -360,6 +361,10 @@ void Rtabmap::init(const ParametersMap & parameters, const std::string & databas
|
||||
if(!_memory)
|
||||
{
|
||||
_memory = new Memory(allParameters);
|
||||
if(_dummyDictionary)
|
||||
{
|
||||
_memory->setDummyDictionary(true);
|
||||
}
|
||||
_memory->init(_databasePath, false, allParameters, true);
|
||||
}
|
||||
|
||||
@@ -6934,6 +6939,18 @@ void Rtabmap::addNodesToRepublish(const std::vector<int> & ids)
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::setDummyDictionary(bool enabled)
|
||||
{
|
||||
if(_memory) {
|
||||
UERROR("Memory is already initialized, cannot set dummy dictionary. This "
|
||||
"function can only be called after Rtabmap object is created, but "
|
||||
"before init() is called.");
|
||||
}
|
||||
else {
|
||||
_dummyDictionary = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::clearPath(int status)
|
||||
{
|
||||
UINFO("status=%d", status);
|
||||
|
||||
Reference in New Issue
Block a user