DBReader: set calibrated true when only scans in db. RegIcp: added intensity matching option when complexity is low. OdomF2M: accept first key frame on low complexity if a guess is provided. DbViewer: added gravity visualization in 3D view.

This commit is contained in:
matlabbe
2021-02-01 11:31:45 -05:00
parent 6b119c1f90
commit b759b1b4d1
5 changed files with 75 additions and 19 deletions

View File

@@ -200,6 +200,18 @@ bool DBReader::init(
{
_calibrated = true;
}
else
{
Signature * s = _dbDriver->loadSignature(*_ids.begin());
_dbDriver->loadNodeData(s);
if( s->sensorData().imageCompressed().empty() &&
s->getWords().empty() &&
!s->sensorData().laserScanCompressed().empty())
{
_calibrated = true; // only scans
}
delete s;
}
}
}
else

View File

@@ -1209,11 +1209,18 @@ Transform RegistrationIcp::computeTransformationImpl(
UWARN("libpointmatcher icp...temporary maxDist=%s (%s=%f, %s=%f)", params["maxDist"].c_str(), Parameters::kIcpMaxCorrespondenceDistance().c_str(), _maxCorrespondenceDistance, Parameters::kIcpVoxelSize().c_str(), _voxelSize);
params["knn"] = uNumber2Str(_libpointmatcherKnn);
params["epsilon"] = uNumber2Str(_libpointmatcherEpsilon);
if(_libpointmatcherIntensity)
{
icpTmp.matcher.reset(new KDTreeMatcherIntensity<float>(params));
}
else
{
#if POINTMATCHER_VERSION_INT >= 10300
icpTmp.matcher = PM::get().MatcherRegistrar.create("KDTreeMatcher", params);
icpTmp.matcher = PM::get().MatcherRegistrar.create("KDTreeMatcher", params);
#else
icpTmp.matcher.reset(PM::get().MatcherRegistrar.create("KDTreeMatcher", params));
icpTmp.matcher.reset(PM::get().MatcherRegistrar.create("KDTreeMatcher", params));
#endif
}
#if POINTMATCHER_VERSION_INT >= 10300
icpTmp.errorMinimizer = PM::get().ErrorMinimizerRegistrar.create("PointToPointErrorMinimizer");

View File

@@ -1322,6 +1322,16 @@ Transform OdometryF2M::computeTransform(
{
frameValid = true;
}
else if(!guess.isNull() && !guess.isIdentity())
{
UWARN("Scan complexity too low (%f) to init robustly the first "
"keyframe. Make sure the lidar is seeing enough "
"geometry in all axes for good initialization. "
"Accepting as an initial guess (%s) is provided.",
complexity,
guess.prettyPrint().c_str());
frameValid = true;
}
}
else
{