mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-11 04:19:50 +08:00
Optimizer: fall back on g2o or gtsam first if one or the other is not available (instead of going TORO). ExportClouds: added ceiling and floor filtering options.
This commit is contained in:
+13
-28
@@ -101,16 +101,16 @@ Optimizer * Optimizer::create(Optimizer::Type type, const ParametersMap & parame
|
|||||||
}
|
}
|
||||||
if(!OptimizerG2O::available() && type == Optimizer::kTypeG2O)
|
if(!OptimizerG2O::available() && type == Optimizer::kTypeG2O)
|
||||||
{
|
{
|
||||||
if(OptimizerTORO::available())
|
if(OptimizerGTSAM::available())
|
||||||
{
|
|
||||||
UWARN("g2o optimizer not available. TORO will be used instead.");
|
|
||||||
type = Optimizer::kTypeTORO;
|
|
||||||
}
|
|
||||||
else if(OptimizerGTSAM::available())
|
|
||||||
{
|
{
|
||||||
UWARN("g2o optimizer not available. GTSAM will be used instead.");
|
UWARN("g2o optimizer not available. GTSAM will be used instead.");
|
||||||
type = Optimizer::kTypeGTSAM;
|
type = Optimizer::kTypeGTSAM;
|
||||||
}
|
}
|
||||||
|
else if(OptimizerTORO::available())
|
||||||
|
{
|
||||||
|
UWARN("g2o optimizer not available. TORO will be used instead.");
|
||||||
|
type = Optimizer::kTypeTORO;
|
||||||
|
}
|
||||||
else if(OptimizerCeres::available())
|
else if(OptimizerCeres::available())
|
||||||
{
|
{
|
||||||
UWARN("g2o optimizer not available. ceres will be used instead.");
|
UWARN("g2o optimizer not available. ceres will be used instead.");
|
||||||
@@ -119,16 +119,16 @@ Optimizer * Optimizer::create(Optimizer::Type type, const ParametersMap & parame
|
|||||||
}
|
}
|
||||||
if(!OptimizerGTSAM::available() && type == Optimizer::kTypeGTSAM)
|
if(!OptimizerGTSAM::available() && type == Optimizer::kTypeGTSAM)
|
||||||
{
|
{
|
||||||
if(OptimizerTORO::available())
|
if(OptimizerG2O::available())
|
||||||
{
|
|
||||||
UWARN("GTSAM optimizer not available. TORO will be used instead.");
|
|
||||||
type = Optimizer::kTypeTORO;
|
|
||||||
}
|
|
||||||
else if(OptimizerG2O::available())
|
|
||||||
{
|
{
|
||||||
UWARN("GTSAM optimizer not available. g2o will be used instead.");
|
UWARN("GTSAM optimizer not available. g2o will be used instead.");
|
||||||
type = Optimizer::kTypeG2O;
|
type = Optimizer::kTypeG2O;
|
||||||
}
|
}
|
||||||
|
else if(OptimizerTORO::available())
|
||||||
|
{
|
||||||
|
UWARN("GTSAM optimizer not available. TORO will be used instead.");
|
||||||
|
type = Optimizer::kTypeTORO;
|
||||||
|
}
|
||||||
else if(OptimizerCeres::available())
|
else if(OptimizerCeres::available())
|
||||||
{
|
{
|
||||||
UWARN("GTSAM optimizer not available. ceres will be used instead.");
|
UWARN("GTSAM optimizer not available. ceres will be used instead.");
|
||||||
@@ -137,26 +137,11 @@ Optimizer * Optimizer::create(Optimizer::Type type, const ParametersMap & parame
|
|||||||
}
|
}
|
||||||
if(!OptimizerCVSBA::available() && type == Optimizer::kTypeCVSBA)
|
if(!OptimizerCVSBA::available() && type == Optimizer::kTypeCVSBA)
|
||||||
{
|
{
|
||||||
if(OptimizerTORO::available())
|
if(OptimizerG2O::available())
|
||||||
{
|
|
||||||
UWARN("CVSBA optimizer not available. TORO will be used instead.");
|
|
||||||
type = Optimizer::kTypeTORO;
|
|
||||||
}
|
|
||||||
else if(OptimizerGTSAM::available())
|
|
||||||
{
|
|
||||||
UWARN("CVSBA optimizer not available. GTSAM will be used instead.");
|
|
||||||
type = Optimizer::kTypeGTSAM;
|
|
||||||
}
|
|
||||||
else if(OptimizerG2O::available())
|
|
||||||
{
|
{
|
||||||
UWARN("CVSBA optimizer not available. g2o will be used instead.");
|
UWARN("CVSBA optimizer not available. g2o will be used instead.");
|
||||||
type = Optimizer::kTypeG2O;
|
type = Optimizer::kTypeG2O;
|
||||||
}
|
}
|
||||||
else if(OptimizerCeres::available())
|
|
||||||
{
|
|
||||||
UWARN("CVSBA optimizer not available. ceres will be used instead.");
|
|
||||||
type = Optimizer::kTypeCeres;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!OptimizerCeres::available() && type == Optimizer::kTypeCeres)
|
if(!OptimizerCeres::available() && type == Optimizer::kTypeCeres)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3209,6 +3209,18 @@ std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::Indic
|
|||||||
UERROR("Cloud %d not found in cache!", iter->first);
|
UERROR("Cloud %d not found in cache!", iter->first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!cloud->empty() &&
|
||||||
|
(_ui->doubleSpinBox_ceilingHeight->value() != 0.0 || _ui->doubleSpinBox_floorHeight->value() != 0.0))
|
||||||
|
{
|
||||||
|
float min = _ui->doubleSpinBox_floorHeight->value();
|
||||||
|
float max = _ui->doubleSpinBox_ceilingHeight->value();
|
||||||
|
indices = util3d::passThrough(
|
||||||
|
util3d::transformPointCloud(cloud, iter->second),
|
||||||
|
indices,
|
||||||
|
"z",
|
||||||
|
min!=0.0f&&min<max?min:std::numeric_limits<float>::lowest(),
|
||||||
|
max!=0.0f?max:std::numeric_limits<float>::max());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(_ui->checkBox_fromDepth->isChecked() && uContains(cachedClouds, iter->first))
|
else if(_ui->checkBox_fromDepth->isChecked() && uContains(cachedClouds, iter->first))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-2387</y>
|
<y>-547</y>
|
||||||
<width>780</width>
|
<width>780</width>
|
||||||
<height>4880</height>
|
<height>4944</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||||
@@ -397,14 +397,14 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1">
|
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1">
|
||||||
<item row="6" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QToolButton" name="toolButton_distortionModel">
|
<widget class="QToolButton" name="toolButton_distortionModel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QSpinBox" name="spinBox_fillDepthHoles">
|
<widget class="QSpinBox" name="spinBox_fillDepthHoles">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> pixels</string>
|
<string> pixels</string>
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>1</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>100.000000000000000</double>
|
<double>100.000000000000000</double>
|
||||||
@@ -453,10 +453,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="8" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_distortionModel"/>
|
<widget class="QLineEdit" name="lineEdit_distortionModel"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QSpinBox" name="spinBox_fillDepthHolesError">
|
<widget class="QSpinBox" name="spinBox_fillDepthHolesError">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string> %</string>
|
<string> %</string>
|
||||||
@@ -483,7 +483,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="6" column="2">
|
||||||
<widget class="QLabel" name="label_197">
|
<widget class="QLabel" name="label_197">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fill depth hole size (0 means no fill).</string>
|
<string>Fill depth hole size (0 means no fill).</string>
|
||||||
@@ -502,7 +502,7 @@
|
|||||||
<string> m</string>
|
<string> m</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="decimals">
|
||||||
<number>1</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<double>100.000000000000000</double>
|
<double>100.000000000000000</double>
|
||||||
@@ -515,7 +515,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QLabel" name="label_134">
|
<widget class="QLabel" name="label_134">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Path to a depth distortion model to apply (output from depth calibration).</string>
|
<string>Path to a depth distortion model to apply (output from depth calibration).</string>
|
||||||
@@ -525,7 +525,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2">
|
<item row="7" column="2">
|
||||||
<widget class="QLabel" name="label_198">
|
<widget class="QLabel" name="label_198">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fill depth hole error.</string>
|
<string>Fill depth hole error.</string>
|
||||||
@@ -538,7 +538,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QLabel" name="label_135">
|
<widget class="QLabel" name="label_135">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ROI ratios [left, right, top, bottom] between 0 and 1. Only generate 3D points for pixels inside the region of interest (RGB image).</string>
|
<string>ROI ratios [left, right, top, bottom] between 0 and 1. Only generate 3D points for pixels inside the region of interest (RGB image).</string>
|
||||||
@@ -548,17 +548,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QLineEdit" name="lineEdit_roiRatios"/>
|
<widget class="QLineEdit" name="lineEdit_roiRatios"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QCheckBox" name="checkBox_bilateral">
|
<widget class="QCheckBox" name="checkBox_bilateral">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="9" column="2">
|
||||||
<widget class="QLabel" name="label_136">
|
<widget class="QLabel" name="label_136">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Bilateral filtering of the depth image. Reduce noise in depth images.</string>
|
<string>Bilateral filtering of the depth image. Reduce noise in depth images.</string>
|
||||||
@@ -568,7 +568,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="2">
|
<item row="10" column="2">
|
||||||
<widget class="QLabel" name="label_137">
|
<widget class="QLabel" name="label_137">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cloud subtraction. Superposed points from different nodes are filtered.</string>
|
<string>Cloud subtraction. Superposed points from different nodes are filtered.</string>
|
||||||
@@ -578,13 +578,71 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
<item row="10" column="1">
|
||||||
<widget class="QCheckBox" name="checkBox_subtraction">
|
<widget class="QCheckBox" name="checkBox_subtraction">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QLabel" name="label_140">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ceiling filtering height.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QLabel" name="label_141">
|
||||||
|
<property name="text">
|
||||||
|
<string>Floor filtering height.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_ceilingHeight">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> m</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>100.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_floorHeight">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> m</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>100.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user