Merge branch 'master' of https://github.com/introlab/rtabmap into jade-devel

This commit is contained in:
matlabbe
2015-05-12 08:29:41 -04:00
6 changed files with 56 additions and 26 deletions
+1
View File
@@ -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<int, int> getNeighborsId(
int signatureId,
int maxGraphDepth,
+34 -18
View File
@@ -1625,24 +1625,10 @@ void Memory::moveToTrash(Signature * s, bool keepLinkedToGraph, std::list<int> *
}
else
{
//make sure that virtual links are removed
const std::map<int, Link> & links = s->getLinks();
for(std::map<int, Link>::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<int, Link> & links = s->getLinks();
for(std::map<int, Link>::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());
+9
View File
@@ -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;
+3 -3
View File
@@ -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");
}
+4
View File
@@ -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");
}
}
}
+5 -5
View File
@@ -63,9 +63,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-591</y>
<width>760</width>
<height>1502</height>
<y>0</y>
<width>755</width>
<height>1557</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
@@ -86,7 +86,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>3</number>
<number>19</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -5007,7 +5007,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
<string> m</string>
</property>
<property name="decimals">
<number>2</number>
<number>3</number>
</property>
<property name="singleStep">
<double>0.100000000000000</double>