Support intermediate nodes with memory management enabled (#1687)

* Support intermediate nodes with memory management enabled

* Adding fix from #1686

* Fixed odomCache overlay shown in mapping mode

* Fixed local retrieval with intermediate nodes

* bumping version for updating API. Fixed getting graph error.

* Disable planning if intermediate nodes are there. Updated usage of Kp/BadSignRatio to support intermediate nodes.
This commit is contained in:
matlabbe
2026-04-19 16:08:03 -07:00
committed by GitHub
parent cc86af4399
commit 9cbe84e445
15 changed files with 385 additions and 140 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ void DataRecorder::addData(const rtabmap::SensorData & data, const Transform & p
//save to database
UTimer time;
memory_->update(data, pose, covariance);
const Signature * s = memory_->getLastWorkingSignature();
const Signature * s = memory_->getLastWorkingSignature(false);
totalSizeKB_ += (int)s->sensorData().imageCompressed().total()/1000;
totalSizeKB_ += (int)s->sensorData().depthOrRightCompressed().total()/1000;
totalSizeKB_ += (int)s->sensorData().laserScanCompressed().data().total()/1000;
+1 -2
View File
@@ -7930,8 +7930,7 @@ void DatabaseViewer::updateGraphView()
// remove intermediate nodes?
if(ui_->checkBox_ignoreIntermediateNodes->isVisible() &&
ui_->checkBox_ignoreIntermediateNodes->isEnabled() &&
ui_->checkBox_ignoreIntermediateNodes->isChecked())
(ui_->checkBox_ignoreIntermediateNodes->isChecked() || ui_->comboBox_optimizationFlavor->currentIndex() == 2))
{
for(std::multimap<int, Link>::iterator iter=links.begin(); iter!=links.end(); ++iter)
{
+7 -7
View File
@@ -585,6 +585,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
// Apply state
this->changeState(kIdle);
this->applyPrefSettings(PreferencesDialog::kPanelAll);
applyPrefSettings(parameters, false);
_ui->statsToolBox->setNewFigureMaxItems(50);
_ui->statsToolBox->setWorkingDirectory(_preferencesDialog->getWorkingDirectory());
@@ -709,10 +710,6 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
this->loadFigures();
connect(_ui->statsToolBox, SIGNAL(figuresSetupChanged()), this, SLOT(configGUIModified()));
// update loop closure viewer parameters
_loopClosureViewer->setDecimation(_preferencesDialog->getCloudDecimation(0));
_loopClosureViewer->setMaxDepth(_preferencesDialog->getCloudMaxDepth(0));
if (splash)
{
splash->close();
@@ -3254,14 +3251,17 @@ void MainWindow::updateMapCloud(
}
std::map<int, Transform> posesWithOdomCache;
std::set<int> odomCachePosesIds;
if(_ui->graphicsView_graphView->isVisible() ||
((_preferencesDialog->isGraphsShown() || _preferencesDialog->isFrustumsShown(0)) && _currentPosesMap.size()))
{
posesWithOdomCache = posesIn;
for(std::map<int, Transform>::const_iterator iter=odomCachePoses.begin(); iter!=odomCachePoses.end(); ++iter)
{
posesWithOdomCache.insert(std::make_pair(iter->first, _odometryCorrection*iter->second));
if(posesWithOdomCache.insert(std::make_pair(iter->first, _odometryCorrection*iter->second)).second)
{
odomCachePosesIds.insert(iter->first);
}
}
}
@@ -3520,7 +3520,7 @@ void MainWindow::updateMapCloud(
std::multimap<int, Link> constraintsWithOdomCache;
constraintsWithOdomCache = constraints;
constraintsWithOdomCache.insert(odomCacheConstraints.begin(), odomCacheConstraints.end());
_ui->graphicsView_graphView->updateGraph(posesWithOdomCache, constraintsWithOdomCache, mapIdsIn, std::map<int, int>(), uKeysSet(odomCachePoses));
_ui->graphicsView_graphView->updateGraph(posesWithOdomCache, constraintsWithOdomCache, mapIdsIn, std::map<int, int>(), odomCachePosesIds);
if(_preferencesDialog->isGroundTruthAligned() && !mapToGt.isIdentity())
{
std::map<int, Transform> gtPoses = _currentGTPosesMap;