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_STR(Rtabmap, WorkingDirectory, Parameters::getDefaultWorkingDirectory()); // Working directory
RTABMAP_PARAM(Rtabmap, LocalGraphCleaned, bool, false); // Clean the neighborhood of the retrieved id 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, 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) RTABMAP_PARAM(Rtabmap, ActionsSentRejectHyp, bool, false); // Actions sent also on rejected hypotheses (on decreasing hypotheses)
// Hypotheses selection // Hypotheses selection

View File

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

View File

@@ -68,7 +68,7 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>7</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="page_22"> <widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29"> <layout class="QVBoxLayout" name="verticalLayout_29">
@@ -990,7 +990,7 @@ when using the file type, logs are saved in Logrtabmap.txt (located in the worki
<item row="7" column="2"> <item row="7" column="2">
<widget class="QLabel" name="label_39"> <widget class="QLabel" name="label_39">
<property name="text"> <property name="text">
<string>Select next actions based only on the more recent neighbor of the current node, otherwise, weight is also used.</string> <string>Select next actions using directly the more recent neighbor of the current node, otherwise, highest hypothesis is used</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>