mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 18:17:47 +08:00
Odom ICP: added min ratio gate to init first scan (#1768)
This commit is contained in:
@@ -1469,6 +1469,25 @@ Transform OdometryF2M::computeTransform(
|
||||
}
|
||||
}
|
||||
|
||||
const int scanMaxPoints = lastFrame_->sensorData().laserScanRaw().maxPoints();
|
||||
if(frameValid && scanMaxPoints > 0)
|
||||
{
|
||||
float correspondenceRatio = Parameters::defaultIcpCorrespondenceRatio();
|
||||
Parameters::parse(parameters_, Parameters::kIcpCorrespondenceRatio(), correspondenceRatio);
|
||||
if(float(lastFrame_->sensorData().laserScanRaw().size()) <
|
||||
float(scanMaxPoints) * correspondenceRatio)
|
||||
{
|
||||
UWARN("Scan has %d points of the %d of a full sweep, under the %s=%f "
|
||||
"that a registration against it would have to reach, so no "
|
||||
"later scan could be matched to it. Not initializing on it.",
|
||||
(int)lastFrame_->sensorData().laserScanRaw().size(),
|
||||
scanMaxPoints,
|
||||
Parameters::kIcpCorrespondenceRatio().c_str(),
|
||||
correspondenceRatio);
|
||||
frameValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(frameValid)
|
||||
{
|
||||
if (scanMapMaxRange_ > 0 ){
|
||||
|
||||
Reference in New Issue
Block a user