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

@@ -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;
}
}