mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Added confidence threshold parameter
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@310 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -65,6 +65,7 @@ Rtabmap::Rtabmap() :
|
||||
_maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()),
|
||||
_actionsByTime(Parameters::defaultRtabmapActionsByTime()),
|
||||
_actionsSentRejectHyp(Parameters::defaultRtabmapActionsSentRejectHyp()),
|
||||
_confidenceThr(Parameters::defaultRtabmapConfidenceThr()),
|
||||
_lcHypothesisId(0),
|
||||
_reactivateId(0),
|
||||
_highestHypothesisValue(0),
|
||||
@@ -283,6 +284,10 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
|
||||
{
|
||||
_actionsSentRejectHyp = uStr2Bool(iter->second.c_str());
|
||||
}
|
||||
if((iter=parameters.find(Parameters::kRtabmapConfidenceThr())) != parameters.end())
|
||||
{
|
||||
_confidenceThr = std::atof(iter->second.c_str());
|
||||
}
|
||||
|
||||
// By default, we create our strategies if they are not already created.
|
||||
// If they already exists, we check the parameters if a change is requested
|
||||
@@ -946,7 +951,7 @@ void Rtabmap::process()
|
||||
}
|
||||
|
||||
// only send actions if rejectLoopReason!=3 (decreasing hypotheses)
|
||||
if(sLoop && (_actionsSentRejectHyp || !rejectedHypothesis))
|
||||
if(sLoop && (_actionsSentRejectHyp || !rejectedHypothesis) && (_highestHypothesisValue > _confidenceThr))
|
||||
{
|
||||
// select the actions of the neighbor with the highest
|
||||
// weight (select the more recent if some have the same weight)
|
||||
|
||||
Reference in New Issue
Block a user