mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
DbViewer: Updated add constraint order (from=old, to=newer)
This commit is contained in:
@@ -7088,7 +7088,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
|||||||
if(from == to)
|
if(from == to)
|
||||||
{
|
{
|
||||||
UWARN("Cannot add link to same node");
|
UWARN("Cannot add link to same node");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(from > to)
|
else if(from > to)
|
||||||
{
|
{
|
||||||
@@ -7398,6 +7398,10 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
|||||||
//simply remove from linksRemoved
|
//simply remove from linksRemoved
|
||||||
linksRemoved_.erase(rtabmap::graph::findLink(linksRemoved_, from, to));
|
linksRemoved_.erase(rtabmap::graph::findLink(linksRemoved_, from, to));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(newLink.from() < newLink.to())
|
||||||
|
{
|
||||||
newLink = newLink.inverse();
|
newLink = newLink.inverse();
|
||||||
}
|
}
|
||||||
linksAdded_.insert(std::make_pair(newLink.from(), newLink));
|
linksAdded_.insert(std::make_pair(newLink.from(), newLink));
|
||||||
|
|||||||
Reference in New Issue
Block a user