mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added parameter "g2o/PixelVariance" (default 1)
This commit is contained in:
@@ -3887,6 +3887,7 @@ void MainWindow::postProcessing()
|
||||
bool sba = _postProcessingDialog->isSBA();
|
||||
int sbaIterations = _postProcessingDialog->sbaIterations();
|
||||
double sbaEpsilon = _postProcessingDialog->sbaEpsilon();
|
||||
double sbaVariance = _postProcessingDialog->sbaVariance();
|
||||
Optimizer::Type sbaType = _postProcessingDialog->sbaType();
|
||||
|
||||
if(!detectMoreLoopClosures && !refineNeighborLinks && !refineLoopClosureLinks && !sba)
|
||||
@@ -4186,6 +4187,7 @@ void MainWindow::postProcessing()
|
||||
ParametersMap parametersSBA = _preferencesDialog->getAllParameters();
|
||||
uInsert(parametersSBA, std::make_pair(Parameters::kOptimizerIterations(), uNumber2Str(sbaIterations)));
|
||||
uInsert(parametersSBA, std::make_pair(Parameters::kOptimizerEpsilon(), uNumber2Str(sbaEpsilon)));
|
||||
uInsert(parametersSBA, std::make_pair(Parameters::kg2oPixelVariance(), uNumber2Str(sbaVariance)));
|
||||
Optimizer * sba = Optimizer::create(sbaType, parametersSBA);
|
||||
std::map<int, Transform> newPoses = sba->optimizeBA(optimizedPoses.begin()->first, optimizedPoses, linksOut, _cachedSignatures.toStdMap());
|
||||
delete sba;
|
||||
|
||||
@@ -74,6 +74,9 @@ PostProcessingDialog::PostProcessingDialog(QWidget * parent) :
|
||||
connect(_ui->sba_iterations, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
||||
connect(_ui->sba_epsilon, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
|
||||
connect(_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(int)), this, SIGNAL(configChanged()));
|
||||
connect(_ui->comboBox_sbaType, SIGNAL(currentIndexChanged(int)), this, SLOT(updateVisibility()));
|
||||
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
PostProcessingDialog::~PostProcessingDialog()
|
||||
@@ -81,6 +84,12 @@ PostProcessingDialog::~PostProcessingDialog()
|
||||
delete _ui;
|
||||
}
|
||||
|
||||
void PostProcessingDialog::updateVisibility()
|
||||
{
|
||||
_ui->sba_variance->setVisible(_ui->comboBox_sbaType->currentIndex() == 0);
|
||||
_ui->label_variance->setVisible(_ui->comboBox_sbaType->currentIndex() == 0);
|
||||
}
|
||||
|
||||
void PostProcessingDialog::saveSettings(QSettings & settings, const QString & group) const
|
||||
{
|
||||
if(!group.isEmpty())
|
||||
@@ -97,6 +106,7 @@ void PostProcessingDialog::saveSettings(QSettings & settings, const QString & gr
|
||||
settings.setValue("sba_iterations", this->sbaIterations());
|
||||
settings.setValue("sba_epsilon", this->sbaEpsilon());
|
||||
settings.setValue("sba_type", this->sbaType());
|
||||
settings.setValue("sba_variance", this->sbaVariance());
|
||||
if(!group.isEmpty())
|
||||
{
|
||||
settings.endGroup();
|
||||
@@ -119,6 +129,7 @@ void PostProcessingDialog::loadSettings(QSettings & settings, const QString & gr
|
||||
this->setSBAIterations(settings.value("sba_iterations", this->sbaIterations()).toInt());
|
||||
this->setSBAEpsilon(settings.value("sba_epsilon", this->sbaEpsilon()).toDouble());
|
||||
this->setSBAType((Optimizer::Type)settings.value("sba_type", this->sbaType()).toInt());
|
||||
this->setSBAVariance(settings.value("sba_variance", this->sbaVariance()).toDouble());
|
||||
if(!group.isEmpty())
|
||||
{
|
||||
settings.endGroup();
|
||||
@@ -135,8 +146,9 @@ void PostProcessingDialog::restoreDefaults()
|
||||
setRefineLoopClosureLinks(false);
|
||||
setSBA(false);
|
||||
setSBAIterations(20);
|
||||
setSBAEpsilon(0.0001);
|
||||
setSBAEpsilon(0.0);
|
||||
setSBAType(!Optimizer::isAvailable(Optimizer::kTypeG2O)&&Optimizer::isAvailable(Optimizer::kTypeCVSBA)?Optimizer::kTypeCVSBA:Optimizer::kTypeG2O);
|
||||
setSBAVariance(1.0);
|
||||
}
|
||||
|
||||
void PostProcessingDialog::updateButtonBox()
|
||||
@@ -188,6 +200,10 @@ double PostProcessingDialog::sbaEpsilon() const
|
||||
{
|
||||
return _ui->sba_epsilon->value();
|
||||
}
|
||||
double PostProcessingDialog::sbaVariance() const
|
||||
{
|
||||
return _ui->sba_variance->value();
|
||||
}
|
||||
Optimizer::Type PostProcessingDialog::sbaType() const
|
||||
{
|
||||
return _ui->comboBox_sbaType->currentIndex()==0?Optimizer::kTypeG2O:Optimizer::kTypeCVSBA;
|
||||
@@ -230,6 +246,10 @@ void PostProcessingDialog::setSBAEpsilon(double epsilon)
|
||||
{
|
||||
_ui->sba_epsilon->setValue(epsilon);
|
||||
}
|
||||
void PostProcessingDialog::setSBAVariance(double variance)
|
||||
{
|
||||
_ui->sba_variance->setValue(variance);
|
||||
}
|
||||
void PostProcessingDialog::setSBAType(Optimizer::Type type)
|
||||
{
|
||||
if(type == Optimizer::kTypeCVSBA)
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
bool isSBA() const;
|
||||
int sbaIterations() const;
|
||||
double sbaEpsilon() const;
|
||||
double sbaVariance() const;
|
||||
Optimizer::Type sbaType() const;
|
||||
|
||||
//setters
|
||||
@@ -72,6 +73,7 @@ public:
|
||||
void setSBA(bool on);
|
||||
void setSBAIterations(int iterations);
|
||||
void setSBAEpsilon(double epsilon);
|
||||
void setSBAVariance(double variance);
|
||||
void setSBAType(Optimizer::Type type);
|
||||
|
||||
signals:
|
||||
@@ -81,6 +83,7 @@ public slots:
|
||||
void restoreDefaults();
|
||||
|
||||
private slots:
|
||||
void updateVisibility();
|
||||
void updateButtonBox();
|
||||
|
||||
|
||||
|
||||
@@ -658,6 +658,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
|
||||
_ui->comboBox_g2o_solver->setObjectName(Parameters::kg2oSolver().c_str());
|
||||
_ui->comboBox_g2o_optimizer->setObjectName(Parameters::kg2oOptimizer().c_str());
|
||||
_ui->doubleSpinBox_g2o_variance->setObjectName(Parameters::kg2oPixelVariance().c_str());
|
||||
|
||||
_ui->graphPlan_goalReachedRadius->setObjectName(Parameters::kRGBDGoalReachedRadius().c_str());
|
||||
_ui->graphPlan_goalsSavedInUserData->setObjectName(Parameters::kRGBDGoalsSavedInUserData().c_str());
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
<number>999999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
@@ -217,7 +217,7 @@
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000100000000000</double>
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
@@ -260,6 +260,38 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_variance">
|
||||
<property name="text">
|
||||
<string>Pixel variance used by g2o.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QDoubleSpinBox" name="sba_variance">
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-1161</y>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<height>2010</height>
|
||||
<height>2044</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@@ -86,7 +86,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>12</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_22">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
|
||||
@@ -7060,6 +7060,35 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_g2o_variance">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000100000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_148">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pixel variance for SBA.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user