mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user