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)
|
||||
{
|
||||
UWARN("Cannot add link to same node");
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
else if(from > to)
|
||||
{
|
||||
@@ -7398,6 +7398,10 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
||||
//simply remove from linksRemoved
|
||||
linksRemoved_.erase(rtabmap::graph::findLink(linksRemoved_, from, to));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(newLink.from() < newLink.to())
|
||||
{
|
||||
newLink = newLink.inverse();
|
||||
}
|
||||
linksAdded_.insert(std::make_pair(newLink.from(), newLink));
|
||||
|
||||
Reference in New Issue
Block a user