mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Parameters: renamed Rtabmap/VhStrategy to VhEp/Enabled
This commit is contained in:
@@ -168,7 +168,6 @@ typedef std::pair<std::string, std::string> ParametersPair;
|
||||
class RTABMAP_EXP Parameters
|
||||
{
|
||||
// Rtabmap parameters
|
||||
RTABMAP_PARAM(Rtabmap, VhStrategy, int, 0, "None 0, Similarity 1, Epipolar 2.");
|
||||
RTABMAP_PARAM(Rtabmap, PublishStats, bool, true, "Publishing statistics.");
|
||||
RTABMAP_PARAM(Rtabmap, PublishLastSignature, bool, true, "Publishing last signature.");
|
||||
RTABMAP_PARAM(Rtabmap, PublishPdf, bool, true, "Publishing pdf.");
|
||||
@@ -301,9 +300,10 @@ class RTABMAP_EXP Parameters
|
||||
RTABMAP_PARAM(Bayes, FullPredictionUpdate, bool, false, "Regenerate all the prediction matrix on each iteration (otherwise only removed/added ids are updated).");
|
||||
|
||||
// Verify hypotheses
|
||||
RTABMAP_PARAM(VhEp, Enabled, bool, false, uFormat("Verify visual loop closure hypothesis by computing a fundamental matrix. This is done prior to transformation computation when %s is enabled.", kRGBDEnabled().c_str()));
|
||||
RTABMAP_PARAM(VhEp, MatchCountMin, int, 8, "Minimum of matching visual words pairs to accept the loop hypothesis.");
|
||||
RTABMAP_PARAM(VhEp, RansacParam1, float, 3, "Fundamental matrix (see cvFindFundamentalMat()): Max distance (in pixels) from the epipolar line for a point to be inlier.");
|
||||
RTABMAP_PARAM(VhEp, RansacParam2, float, 0.99, "Fundamental matrix (see cvFindFundamentalMat()): Performance of the RANSAC.");
|
||||
RTABMAP_PARAM(VhEp, RansacParam2, float, 0.99, "Fundamental matrix (see cvFindFundamentalMat()): Performance of RANSAC.");
|
||||
|
||||
// RGB-D SLAM
|
||||
RTABMAP_PARAM(RGBD, Enabled, bool, true, "");
|
||||
|
||||
@@ -215,6 +215,7 @@ private:
|
||||
unsigned int _maxMemoryAllowed; // signatures count in WM
|
||||
float _loopThr;
|
||||
float _loopRatio;
|
||||
bool _verifyLoopClosureHypothesis;
|
||||
unsigned int _maxRetrieved;
|
||||
unsigned int _maxLocalRetrieved;
|
||||
bool _rawDataKept;
|
||||
|
||||
@@ -224,6 +224,9 @@ const std::map<std::string, std::pair<bool, std::string> > & Parameters::getRemo
|
||||
{
|
||||
// removed parameters
|
||||
|
||||
// 0.13.1
|
||||
removedParameters_.insert(std::make_pair("Rtabmap/VhStrategy", std::make_pair(true, Parameters::kVhEpEnabled())));
|
||||
|
||||
// 0.12.5
|
||||
removedParameters_.insert(std::make_pair("Grid/FullUpdate", std::make_pair(true, Parameters::kGridGlobalFullUpdate())));
|
||||
|
||||
|
||||
+5
-14
@@ -83,6 +83,7 @@ Rtabmap::Rtabmap() :
|
||||
_maxMemoryAllowed(Parameters::defaultRtabmapMemoryThr()), // 0=inf
|
||||
_loopThr(Parameters::defaultRtabmapLoopThr()),
|
||||
_loopRatio(Parameters::defaultRtabmapLoopRatio()),
|
||||
_verifyLoopClosureHypothesis(Parameters::defaultVhEpEnabled()),
|
||||
_maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()),
|
||||
_maxLocalRetrieved(Parameters::defaultRGBDMaxLocalRetrieved()),
|
||||
_rawDataKept(Parameters::defaultMemImageKept()),
|
||||
@@ -401,6 +402,7 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
|
||||
Parameters::parse(parameters, Parameters::kRtabmapMemoryThr(), _maxMemoryAllowed);
|
||||
Parameters::parse(parameters, Parameters::kRtabmapLoopThr(), _loopThr);
|
||||
Parameters::parse(parameters, Parameters::kRtabmapLoopRatio(), _loopRatio);
|
||||
Parameters::parse(parameters, Parameters::kVhEpEnabled(), _verifyLoopClosureHypothesis);
|
||||
Parameters::parse(parameters, Parameters::kRtabmapMaxRetrieved(), _maxRetrieved);
|
||||
Parameters::parse(parameters, Parameters::kRGBDMaxLocalRetrieved(), _maxLocalRetrieved);
|
||||
Parameters::parse(parameters, Parameters::kMemImageKept(), _rawDataKept);
|
||||
@@ -470,22 +472,11 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
|
||||
_memory->parseParameters(parameters);
|
||||
}
|
||||
|
||||
VhStrategy vhStrategy = kVhUndef;
|
||||
// Verifying hypotheses strategy
|
||||
if((iter=parameters.find(Parameters::kRtabmapVhStrategy())) != parameters.end())
|
||||
{
|
||||
vhStrategy = (VhStrategy)std::atoi((*iter).second.c_str());
|
||||
}
|
||||
if(!_epipolarGeometry && vhStrategy == kVhEpipolar)
|
||||
if(!_epipolarGeometry)
|
||||
{
|
||||
_epipolarGeometry = new EpipolarGeometry(_parameters);
|
||||
}
|
||||
else if(_epipolarGeometry && vhStrategy == kVhNone)
|
||||
{
|
||||
delete _epipolarGeometry;
|
||||
_epipolarGeometry = 0;
|
||||
}
|
||||
else if(_epipolarGeometry)
|
||||
else
|
||||
{
|
||||
_epipolarGeometry->parseParameters(parameters);
|
||||
}
|
||||
@@ -1407,7 +1398,7 @@ bool Rtabmap::process(
|
||||
// Ignore loop closure if there is only one loop closure hypothesis
|
||||
UDEBUG("rejected hypothesis: single hypothesis");
|
||||
}
|
||||
else if(_epipolarGeometry && !_epipolarGeometry->check(signature, _memory->getSignature(_highestHypothesis.first)))
|
||||
else if(_verifyLoopClosureHypothesis && !_epipolarGeometry->check(signature, _memory->getSignature(_highestHypothesis.first)))
|
||||
{
|
||||
UWARN("rejected hypothesis: by epipolar geometry");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user