From ebfcf77294398547c923af47d675c7ab762a1741 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 11 May 2015 11:05:38 -0400 Subject: [PATCH 1/3] Updated About dialog --- guilib/src/AboutDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guilib/src/AboutDialog.cpp b/guilib/src/AboutDialog.cpp index f457a3d3..c69c7010 100644 --- a/guilib/src/AboutDialog.cpp +++ b/guilib/src/AboutDialog.cpp @@ -55,9 +55,9 @@ AboutDialog::AboutDialog(QWidget * parent) : _ui->label_pcl_version->setText(PCL_VERSION_PRETTY); _ui->label_freenect->setText(CameraFreenect::available()?"Yes":"No"); _ui->label_openni2->setText(CameraOpenNI2::available()?"Yes":"No"); - _ui->label_openni2->setText(CameraFreenect2::available()?"Yes":"No"); - _ui->label_openni2->setText(CameraStereoDC1394::available()?"Yes":"No"); - _ui->label_openni2->setText(CameraStereoFlyCapture2::available()?"Yes":"No"); + _ui->label_freenect2->setText(CameraFreenect2::available()?"Yes":"No"); + _ui->label_dc1394->setText(CameraStereoDC1394::available()?"Yes":"No"); + _ui->label_flycapture2->setText(CameraStereoFlyCapture2::available()?"Yes":"No"); _ui->label_g2o->setText(graph::G2OOptimizer::available()?"Yes":"No"); } From c0386be098480ad029a5ddf284c9b94487551460 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 11 May 2015 14:20:04 -0400 Subject: [PATCH 2/3] DbViewer: remove constraint clouds when 3D words are not available and referred checkbox checked --- guilib/src/DatabaseViewer.cpp | 4 ++++ guilib/src/ui/preferencesDialog.ui | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/guilib/src/DatabaseViewer.cpp b/guilib/src/DatabaseViewer.cpp index 9054f6b0..34fc6092 100644 --- a/guilib/src/DatabaseViewer.cpp +++ b/guilib/src/DatabaseViewer.cpp @@ -2112,6 +2112,7 @@ void DatabaseViewer::updateConstraintView( else { UWARN("Empty 3D words for node %d", link.from()); + ui_->constraintsViewer->removeCloud("cloud0"); } if(cloudTo->size()) { @@ -2120,11 +2121,14 @@ void DatabaseViewer::updateConstraintView( else { UWARN("Empty 3D words for node %d", link.to()); + ui_->constraintsViewer->removeCloud("cloud1"); } } else { UERROR("Not found signature %d or %d in RAM", link.from(), link.to()); + ui_->constraintsViewer->removeCloud("cloud0"); + ui_->constraintsViewer->removeCloud("cloud1"); } } } diff --git a/guilib/src/ui/preferencesDialog.ui b/guilib/src/ui/preferencesDialog.ui index 212898b8..3d457a19 100644 --- a/guilib/src/ui/preferencesDialog.ui +++ b/guilib/src/ui/preferencesDialog.ui @@ -63,9 +63,9 @@ 0 - -591 - 760 - 1502 + 0 + 755 + 1557 @@ -86,7 +86,7 @@ QFrame::Raised - 3 + 19 @@ -5007,7 +5007,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag m - 2 + 3 0.100000000000000 From 04bd5967051a2a40297dfbb427257cb2cd561976 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 11 May 2015 15:48:27 -0400 Subject: [PATCH 3/3] Planning update: remove virtual links up to current path index --- corelib/include/rtabmap/core/Memory.h | 1 + corelib/src/Memory.cpp | 52 +++++++++++++++++---------- corelib/src/Rtabmap.cpp | 9 +++++ 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/corelib/include/rtabmap/core/Memory.h b/corelib/include/rtabmap/core/Memory.h index 9a73f166..fedb271f 100644 --- a/corelib/include/rtabmap/core/Memory.h +++ b/corelib/include/rtabmap/core/Memory.h @@ -84,6 +84,7 @@ public: bool addLink(int to, int from, const Transform & transform, Link::Type type, float rotVariance, float transVariance); void updateLink(int fromId, int toId, const Transform & transform, float rotVariance, float transVariance); void removeAllVirtualLinks(); + void removeVirtualLinks(int signatureId); std::map getNeighborsId( int signatureId, int maxGraphDepth, diff --git a/corelib/src/Memory.cpp b/corelib/src/Memory.cpp index 67799580..31df6599 100644 --- a/corelib/src/Memory.cpp +++ b/corelib/src/Memory.cpp @@ -1625,24 +1625,10 @@ void Memory::moveToTrash(Signature * s, bool keepLinkedToGraph, std::list * } else { - //make sure that virtual links are removed - const std::map & links = s->getLinks(); - for(std::map::const_iterator iter=links.begin(); iter!=links.end(); ++iter) - { - if(iter->second.type() == Link::kVirtualClosure) - { - Signature * sTo = this->_getSignature(iter->first); - if(sTo) - { - sTo->removeLink(s->id()); - } - else - { - UERROR("Link %d of %d not in WM/STM?!?", iter->first, s->id()); - } - } - } - s->removeVirtualLinks(); + // Make sure that virtual links are removed. + // It should be called before the signature is + // removed from _signatures below. + removeVirtualLinks(s->id()); } this->disableWordsRef(s->id()); @@ -2729,6 +2715,36 @@ void Memory::removeAllVirtualLinks() } } +void Memory::removeVirtualLinks(int signatureId) +{ + UDEBUG(""); + Signature * s = this->_getSignature(signatureId); + if(s) + { + const std::map & links = s->getLinks(); + for(std::map::const_iterator iter=links.begin(); iter!=links.end(); ++iter) + { + if(iter->second.type() == Link::kVirtualClosure) + { + Signature * sTo = this->_getSignature(iter->first); + if(sTo) + { + sTo->removeLink(s->id()); + } + else + { + UERROR("Link %d of %d not in WM/STM?!?", iter->first, s->id()); + } + } + } + s->removeVirtualLinks(); + } + else + { + UERROR("Signature %d not in WM/STM?!?", signatureId); + } +} + void Memory::dumpMemory(std::string directory) const { UINFO("Dumping memory to directory \"%s\"", directory.c_str()); diff --git a/corelib/src/Rtabmap.cpp b/corelib/src/Rtabmap.cpp index d3f5a459..67295733 100644 --- a/corelib/src/Rtabmap.cpp +++ b/corelib/src/Rtabmap.cpp @@ -3131,6 +3131,15 @@ void Rtabmap::updateGoalIndex() if( _memory && _path.size()) { + // remove all previous virtual links + for(unsigned int i=0; i<_pathCurrentIndex && i<_path.size(); ++i) + { + if(_memory->getSignature(_path[i].first)) + { + _memory->removeVirtualLinks(_path[i].first); + } + } + // Make sure the next signatures on the path are linked together float distanceSoFar = 0.0f; for(unsigned int i=_pathCurrentIndex;