Skip to content

Commit

Permalink
ICP: when max laser scan max pts is not set, use relative corresponde…
Browse files Browse the repository at this point in the history
…nce ratio (backward compatibility)
  • Loading branch information
matlabbe committed Aug 6, 2015
1 parent a88e8dd commit 0350e47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions corelib/src/Memory.cpp
Expand Up @@ -2346,7 +2346,7 @@ Transform Memory::computeIcpTransform(
bool hasConverged = false;
Transform icpT;
int correspondences = 0;
float correspondencesRatio = -1.0f;
float correspondencesRatio = 0.0f;
double variance = 1;
if(_icpPointToPlane)
{
Expand Down Expand Up @@ -2561,8 +2561,9 @@ Transform Memory::computeIcpTransform(
}
else
{
UWARN("Maximum laser scans points not set for signature %d, correspondences ratio set to 0!",
UWARN("Maximum laser scans points not set for signature %d, correspondences ratio set relative instead of absolute!",
newS.id());
correspondencesRatio = float(correspondences)/float(newCloud->size()>oldCloud->size()?newCloud->size():oldCloud->size());
}

UDEBUG("%d->%d hasConverged=%s, variance=%f, correspondences=%d/%d (%f%%)",
Expand Down Expand Up @@ -2756,8 +2757,9 @@ Transform Memory::computeScanMatchingTransform(
}
else
{
UWARN("Maximum laser scans points not set for signature %d, correspondences ratio set to 0!",
UWARN("Maximum laser scans points not set for signature %d, correspondences ratio set relative instead of absolute!",
newS->id());
correspondencesRatio = float(correspondences)/float(newCloud->size());
}

UDEBUG("variance=%f, correspondences=%d/%d (%f%%) %f",
Expand Down

0 comments on commit 0350e47

Please sign in to comment.