normalize variance in loop closure

This commit is contained in:
matlabbe
2017-01-05 17:22:49 -05:00
parent dfb965cfa9
commit 716337b71a
3 changed files with 26 additions and 1 deletions
+7 -1
View File
@@ -4194,6 +4194,9 @@ void DatabaseViewer::refineConstraint(int from, int to, bool silent, bool update
if(!transform.isNull())
{
// normalize variance
info.varianceLin *= transform.getNorm();
info.varianceAng *= transform.getAngle();
Link newLink(currentLink.from(), currentLink.to(), currentLink.type(), transform, info.varianceAng, info.varianceLin);
bool updated = false;
@@ -4290,8 +4293,11 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent, bool updateGra
updateWordsMatching();
}
if(!t.isNull())
if(!t.isNull() && !t.isIdentity())
{
// normalize variance
info.varianceLin *= t.getNorm();
info.varianceAng *= t.getAngle();
newLink = Link(from, to, Link::kUserClosure, t, info.varianceAng, info.varianceLin);
}
else if(!silent)