mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
DbViewer: fixed features not added in right image when adding loop closure
This commit is contained in:
@@ -4250,6 +4250,7 @@ void DatabaseViewer::addConstraint()
|
|||||||
|
|
||||||
bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGraph)
|
bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGraph)
|
||||||
{
|
{
|
||||||
|
bool switchedIds = false;
|
||||||
if(from == to)
|
if(from == to)
|
||||||
{
|
{
|
||||||
UWARN("Cannot add link to same node");
|
UWARN("Cannot add link to same node");
|
||||||
@@ -4257,6 +4258,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGra
|
|||||||
}
|
}
|
||||||
else if(from < to)
|
else if(from < to)
|
||||||
{
|
{
|
||||||
|
switchedIds = true;
|
||||||
int tmp = from;
|
int tmp = from;
|
||||||
from = to;
|
from = to;
|
||||||
to = tmp;
|
to = tmp;
|
||||||
@@ -4293,8 +4295,16 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGra
|
|||||||
|
|
||||||
if(!silent)
|
if(!silent)
|
||||||
{
|
{
|
||||||
ui_->graphicsView_A->setFeatures(fromS.getWords(), dataFrom.depthRaw());
|
if(switchedIds)
|
||||||
ui_->graphicsView_B->setFeatures(toS.getWords(), dataTo.depthRaw());
|
{
|
||||||
|
ui_->graphicsView_A->setFeatures(toS.getWords(), dataTo.depthRaw());
|
||||||
|
ui_->graphicsView_B->setFeatures(fromS.getWords(), dataFrom.depthRaw());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui_->graphicsView_A->setFeatures(fromS.getWords(), dataFrom.depthRaw());
|
||||||
|
ui_->graphicsView_B->setFeatures(toS.getWords(), dataTo.depthRaw());
|
||||||
|
}
|
||||||
updateWordsMatching();
|
updateWordsMatching();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user