Select next actions based on posterior values (highest neighbor's hypothesis is selected)

git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@105 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2011-06-14 13:40:15 +00:00
parent 881772c8fc
commit 8939ac9b2e
3 changed files with 8 additions and 9 deletions

View File

@@ -131,7 +131,7 @@ class RTABMAP_EXP Parameters
RTABMAP_PARAM_STR(Rtabmap, WorkingDirectory, Parameters::getDefaultWorkingDirectory()); // Working directory
RTABMAP_PARAM(Rtabmap, LocalGraphCleaned, bool, false); // Clean the neighborhood of the retrieved id
RTABMAP_PARAM(Rtabmap, MaxRetrieved, unsigned int, 2); // Maximum locations retrieved at the same time from LTM
RTABMAP_PARAM(Rtabmap, ActionsByTime, bool, true); // Select next actions based on the more recent neighbor of the current node, otherwise, weight is also used
RTABMAP_PARAM(Rtabmap, ActionsByTime, bool, false); // Select next actions using directly the more recent neighbor of the current node, otherwise, highest hypothesis is used
RTABMAP_PARAM(Rtabmap, ActionsSentRejectHyp, bool, false); // Actions sent also on rejected hypotheses (on decreasing hypotheses)
// Hypotheses selection

View File

@@ -937,8 +937,7 @@ void Rtabmap::process()
// OR
// select the newest one (with actions)
const NeighborsMap & neighbors = sLoop->getNeighbors();
const Signature * s;
int currentWeight = -1;
float currentHyp = -1;
for(NeighborsMap::const_reverse_iterator iter=neighbors.rbegin(); iter!=neighbors.rend(); ++iter)
{
if(iter->second.size())
@@ -948,12 +947,12 @@ void Rtabmap::process()
_actions = iter->second;
break;
}
else // use also weight
else // use hypothesis value
{
s = _memory->getSignature(iter->first);
if(s && s->getWeight() > currentWeight)
float hyp = uValue(posterior, iter->first, 0.0f);
if(hyp > currentHyp)
{
currentWeight = s->getWeight();
currentHyp = hyp;
_actions = iter->second;
}
}