Added parameter actionsSentRejectedHyp (actions also sent on rejected hypotheses or decreasing hyp), default false

git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@85 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2011-06-08 20:19:37 +00:00
parent edf8bbb735
commit c59d461c81
5 changed files with 35 additions and 7 deletions

View File

@@ -132,6 +132,7 @@ class RTABMAP_EXP Parameters
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, true); // Select next actions based on the more recent neighbor of the current node, otherwise, weight is also used
RTABMAP_PARAM(Rtabmap, ActionsSentRejectHyp, bool, false); // Actions sent also on rejected hypotheses (on decreasing hypotheses)
// Hypotheses selection // Hypotheses selection
RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.10); // Loop closing threshold RTABMAP_PARAM(Rtabmap, LoopThr, float, 0.10); // Loop closing threshold

View File

@@ -134,6 +134,7 @@ private:
bool _localGraphCleaned; bool _localGraphCleaned;
unsigned int _maxRetrieved; unsigned int _maxRetrieved;
bool _actionsByTime; bool _actionsByTime;
bool _actionsSentRejectHyp;
int _lcHypothesisId; int _lcHypothesisId;
int _reactivateId; int _reactivateId;

View File

@@ -64,6 +64,7 @@ Rtabmap::Rtabmap() :
_localGraphCleaned(Parameters::defaultRtabmapLocalGraphCleaned()), _localGraphCleaned(Parameters::defaultRtabmapLocalGraphCleaned()),
_maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()), _maxRetrieved(Parameters::defaultRtabmapMaxRetrieved()),
_actionsByTime(Parameters::defaultRtabmapActionsByTime()), _actionsByTime(Parameters::defaultRtabmapActionsByTime()),
_actionsSentRejectHyp(Parameters::defaultRtabmapActionsSentRejectHyp()),
_lcHypothesisId(0), _lcHypothesisId(0),
_reactivateId(0), _reactivateId(0),
_highestHypothesisValue(0), _highestHypothesisValue(0),
@@ -269,7 +270,10 @@ void Rtabmap::parseParameters(const ParametersMap & parameters)
{ {
_actionsByTime = uStr2Bool(iter->second.c_str()); _actionsByTime = uStr2Bool(iter->second.c_str());
} }
if((iter=parameters.find(Parameters::kRtabmapActionsSentRejectHyp())) != parameters.end())
{
_actionsSentRejectHyp = uStr2Bool(iter->second.c_str());
}
// By default, we create our strategies if they are not already created. // 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 // If they already exists, we check the parameters if a change is requested
@@ -952,7 +956,8 @@ void Rtabmap::process()
sLoop = _memory->getSignature(highestHypothesisId); sLoop = _memory->getSignature(highestHypothesisId);
} }
if(sLoop) // only send actions if rejectLoopReason!=3 (decreasing hypotheses)
if(sLoop && (_actionsSentRejectHyp || rejectLoopReason != 3))
{ {
// select the actions of the neighbor with the highest // select the actions of the neighbor with the highest
// weight (select the more recent if some have the same weight) // weight (select the more recent if some have the same weight)

View File

@@ -111,6 +111,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->general_spinBox_minMemorySizeForLoopDetection->setObjectName(Parameters::kRtabmapMinMemorySizeForLoopDetection().c_str()); _ui->general_spinBox_minMemorySizeForLoopDetection->setObjectName(Parameters::kRtabmapMinMemorySizeForLoopDetection().c_str());
_ui->general_spinBox_maxRetrieved->setObjectName(Parameters::kRtabmapMaxRetrieved().c_str()); _ui->general_spinBox_maxRetrieved->setObjectName(Parameters::kRtabmapMaxRetrieved().c_str());
_ui->general_checkBox_actionsByTime->setObjectName(Parameters::kRtabmapActionsByTime().c_str()); _ui->general_checkBox_actionsByTime->setObjectName(Parameters::kRtabmapActionsByTime().c_str());
_ui->general_checkBox_actionsSentRejectHyp->setObjectName(Parameters::kRtabmapActionsSentRejectHyp().c_str());
_ui->lineEdit_workingDirectory->setObjectName(Parameters::kRtabmapWorkingDirectory().c_str()); _ui->lineEdit_workingDirectory->setObjectName(Parameters::kRtabmapWorkingDirectory().c_str());
connect(_ui->toolButton_workingDirectory, SIGNAL(clicked()), this, SLOT(changeWorkingDirectory())); connect(_ui->toolButton_workingDirectory, SIGNAL(clicked()), this, SLOT(changeWorkingDirectory()));

View File

@@ -913,21 +913,21 @@ when using the file type, logs are saved in Logrtabmap.txt (located in the worki
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="9" column="0">
<widget class="QLineEdit" name="lineEdit_workingDirectory"> <widget class="QLineEdit" name="lineEdit_workingDirectory">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="2"> <item row="9" column="2">
<widget class="QLabel" name="label_87"> <widget class="QLabel" name="label_87">
<property name="text"> <property name="text">
<string>Working directory (where the database is saved/loaded)</string> <string>Working directory (where the database is saved/loaded)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="9" column="1">
<widget class="QToolButton" name="toolButton_workingDirectory"> <widget class="QToolButton" name="toolButton_workingDirectory">
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
@@ -977,6 +977,26 @@ when using the file type, logs are saved in Logrtabmap.txt (located in the worki
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0">
<widget class="QCheckBox" name="general_checkBox_actionsSentRejectHyp">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label_40">
<property name="text">
<string>Actions sent also on rejected hypotheses (on decreasing hypotheses)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -1073,8 +1093,8 @@ We can edit how will like the prediction used in the Bayes filter when there is
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>524</width> <width>26</width>
<height>138</height> <height>78</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">