mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Normalize variance in refined/added loop closure (DbViewer)
This commit is contained in:
@@ -4194,9 +4194,12 @@ void DatabaseViewer::refineConstraint(int from, int to, bool silent, bool update
|
|||||||
|
|
||||||
if(!transform.isNull())
|
if(!transform.isNull())
|
||||||
{
|
{
|
||||||
// normalize variance
|
if(!transform.isIdentity())
|
||||||
info.varianceLin *= transform.getNorm();
|
{
|
||||||
info.varianceAng *= transform.getAngle();
|
// normalize variance
|
||||||
|
info.varianceLin *= transform.getNorm();
|
||||||
|
info.varianceAng *= transform.getAngle();
|
||||||
|
}
|
||||||
Link newLink(currentLink.from(), currentLink.to(), currentLink.type(), transform, info.varianceAng, info.varianceLin);
|
Link newLink(currentLink.from(), currentLink.to(), currentLink.type(), transform, info.varianceAng, info.varianceLin);
|
||||||
|
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
@@ -4293,11 +4296,14 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGra
|
|||||||
updateWordsMatching();
|
updateWordsMatching();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!t.isNull() && !t.isIdentity())
|
if(!t.isNull())
|
||||||
{
|
{
|
||||||
// normalize variance
|
if(!t.isIdentity())
|
||||||
info.varianceLin *= t.getNorm();
|
{
|
||||||
info.varianceAng *= t.getAngle();
|
// normalize variance
|
||||||
|
info.varianceLin *= t.getNorm();
|
||||||
|
info.varianceAng *= t.getAngle();
|
||||||
|
}
|
||||||
newLink = Link(from, to, Link::kUserClosure, t, info.varianceAng, info.varianceLin);
|
newLink = Link(from, to, Link::kUserClosure, t, info.varianceAng, info.varianceLin);
|
||||||
}
|
}
|
||||||
else if(!silent)
|
else if(!silent)
|
||||||
|
|||||||
Reference in New Issue
Block a user