Added OdomLOAM/Resolution parameter

This commit is contained in:
matlabbe
2021-09-22 10:48:59 -04:00
parent cff0d15460
commit 5f65618d40
6 changed files with 111 additions and 69 deletions

View File

@@ -1289,11 +1289,11 @@ MESSAGE(STATUS " *With GTSAM = NO (GTSAM not found)")
ENDIF() ENDIF()
IF(CERES_FOUND) IF(CERES_FOUND)
MESSAGE(STATUS " *With Ceres = YES (License: BSD)") MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = YES (License: BSD)")
ELSEIF(NOT WITH_CERES) ELSEIF(NOT WITH_CERES)
MESSAGE(STATUS " *With Ceres = NO (WITH_CERES=OFF)") MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = NO (WITH_CERES=OFF)")
ELSE() ELSE()
MESSAGE(STATUS " *With Ceres = NO (Ceres not found)") MESSAGE(STATUS " *With Ceres ${Ceres_VERSION} = NO (Ceres not found)")
ENDIF() ENDIF()
IF(G2O_FOUND OR GTSAM_FOUND) IF(G2O_FOUND OR GTSAM_FOUND)

View File

@@ -535,6 +535,7 @@ class RTABMAP_EXP Parameters
// Odometry LOAM // Odometry LOAM
RTABMAP_PARAM(OdomLOAM, Sensor, int, 2, "Velodyne sensor: 0=VLP-16, 1=HDL-32, 2=HDL-64E"); RTABMAP_PARAM(OdomLOAM, Sensor, int, 2, "Velodyne sensor: 0=VLP-16, 1=HDL-32, 2=HDL-64E");
RTABMAP_PARAM(OdomLOAM, ScanPeriod, float, 0.1, "Scan period (s)"); RTABMAP_PARAM(OdomLOAM, ScanPeriod, float, 0.1, "Scan period (s)");
RTABMAP_PARAM(OdomLOAM, Resolution, float, 0.2, "Map resolution");
RTABMAP_PARAM(OdomLOAM, LinVar, float, 0.01, "Linear output variance."); RTABMAP_PARAM(OdomLOAM, LinVar, float, 0.01, "Linear output variance.");
RTABMAP_PARAM(OdomLOAM, AngVar, float, 0.01, "Angular output variance."); RTABMAP_PARAM(OdomLOAM, AngVar, float, 0.01, "Angular output variance.");
RTABMAP_PARAM(OdomLOAM, LocalMapping, bool, true, "Local mapping. It adds more time to compute odometry, but accuracy is significantly improved."); RTABMAP_PARAM(OdomLOAM, LocalMapping, bool, true, "Local mapping. It adds more time to compute odometry, but accuracy is significantly improved.");

View File

@@ -60,7 +60,7 @@ OdometryFLOAM::OdometryFLOAM(const ParametersMap & parameters) :
float scan_period= Parameters::defaultOdomLOAMScanPeriod(); float scan_period= Parameters::defaultOdomLOAMScanPeriod();
float max_dis = Parameters::defaultIcpRangeMax(); float max_dis = Parameters::defaultIcpRangeMax();
float min_dis = Parameters::defaultIcpRangeMin(); float min_dis = Parameters::defaultIcpRangeMin();
float map_resolution = Parameters::defaultIcpVoxelSize(); float map_resolution = Parameters::defaultOdomLOAMResolution();
linVar_ = Parameters::defaultOdomLOAMLinVar(); linVar_ = Parameters::defaultOdomLOAMLinVar();
angVar_ = Parameters::defaultOdomLOAMAngVar(); angVar_ = Parameters::defaultOdomLOAMAngVar();
@@ -68,7 +68,7 @@ OdometryFLOAM::OdometryFLOAM(const ParametersMap & parameters) :
Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scan_period); Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scan_period);
Parameters::parse(parameters, Parameters::kIcpRangeMax(), max_dis); Parameters::parse(parameters, Parameters::kIcpRangeMax(), max_dis);
Parameters::parse(parameters, Parameters::kIcpRangeMin(), min_dis); Parameters::parse(parameters, Parameters::kIcpRangeMin(), min_dis);
Parameters::parse(parameters, Parameters::kIcpVoxelSize(), map_resolution); Parameters::parse(parameters, Parameters::kOdomLOAMResolution(), map_resolution);
UASSERT(scan_period>0.0f); UASSERT(scan_period>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_); Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_);

View File

@@ -52,10 +52,13 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
#endif #endif
{ {
#ifdef RTABMAP_LOAM #ifdef RTABMAP_LOAM
int velodyneType = 0; int velodyneType = Parameters::defaultOdomLOAMSensor();
float mapResolution = Parameters::defaultOdomLOAMResolution();
Parameters::parse(parameters, Parameters::kOdomLOAMSensor(), velodyneType); Parameters::parse(parameters, Parameters::kOdomLOAMSensor(), velodyneType);
Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scanPeriod_); Parameters::parse(parameters, Parameters::kOdomLOAMScanPeriod(), scanPeriod_);
UASSERT(scanPeriod_>0.0f); UASSERT(scanPeriod_>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMResolution(), mapResolution);
UASSERT(mapResolution>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_); Parameters::parse(parameters, Parameters::kOdomLOAMLinVar(), linVar_);
UASSERT(linVar_>0.0f); UASSERT(linVar_>0.0f);
Parameters::parse(parameters, Parameters::kOdomLOAMAngVar(), angVar_); Parameters::parse(parameters, Parameters::kOdomLOAMAngVar(), angVar_);
@@ -75,6 +78,8 @@ OdometryLOAM::OdometryLOAM(const ParametersMap & parameters) :
} }
laserOdometry_ = new loam::BasicLaserOdometry(scanPeriod_); laserOdometry_ = new loam::BasicLaserOdometry(scanPeriod_);
laserMapping_ = new loam::BasicLaserMapping(scanPeriod_); laserMapping_ = new loam::BasicLaserMapping(scanPeriod_);
laserMapping_->downSizeFilterCorner().setLeafSize(mapResolution, mapResolution, mapResolution);
laserMapping_->downSizeFilterSurf().setLeafSize(mapResolution*2.0f, mapResolution*2.0f, mapResolution*2.0f);
#endif #endif
} }

View File

@@ -196,6 +196,9 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
#ifndef RTABMAP_OPENVINS #ifndef RTABMAP_OPENVINS
_ui->odom_strategy->setItemData(10, 0, Qt::UserRole - 1); _ui->odom_strategy->setItemData(10, 0, Qt::UserRole - 1);
#endif #endif
#ifndef RTABMAP_FLOAM
_ui->odom_strategy->setItemData(11, 0, Qt::UserRole - 1);
#endif
#if CV_MAJOR_VERSION < 3 #if CV_MAJOR_VERSION < 3
_ui->stereosgbm_mode->setItemData(2, 0, Qt::UserRole - 1); _ui->stereosgbm_mode->setItemData(2, 0, Qt::UserRole - 1);
@@ -1360,6 +1363,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
// Odometry LOAM // Odometry LOAM
_ui->odom_loam_sensor->setObjectName(Parameters::kOdomLOAMSensor().c_str()); _ui->odom_loam_sensor->setObjectName(Parameters::kOdomLOAMSensor().c_str());
_ui->odom_loam_scan_period->setObjectName(Parameters::kOdomLOAMScanPeriod().c_str()); _ui->odom_loam_scan_period->setObjectName(Parameters::kOdomLOAMScanPeriod().c_str());
_ui->odom_loam_resolution->setObjectName(Parameters::kOdomLOAMResolution().c_str());
_ui->odom_loam_linvar->setObjectName(Parameters::kOdomLOAMLinVar().c_str()); _ui->odom_loam_linvar->setObjectName(Parameters::kOdomLOAMLinVar().c_str());
_ui->odom_loam_angvar->setObjectName(Parameters::kOdomLOAMAngVar().c_str()); _ui->odom_loam_angvar->setObjectName(Parameters::kOdomLOAMAngVar().c_str());
_ui->odom_loam_localMapping->setObjectName(Parameters::kOdomLOAMLocalMapping().c_str()); _ui->odom_loam_localMapping->setObjectName(Parameters::kOdomLOAMLocalMapping().c_str());

View File

@@ -63,7 +63,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-727</y> <y>-573</y>
<width>686</width> <width>686</width>
<height>3905</height> <height>3905</height>
</rect> </rect>
@@ -16278,7 +16278,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
<item> <item>
<widget class="QLabel" name="label_472"> <widget class="QLabel" name="label_472">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;LOAM: &lt;a href=&quot;https://github.com/laboshinl/loam_velodyne&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/laboshinl/loam_velodyne&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Velodyne input required. Currently tested only with KITTI data set.&lt;/p&gt;&lt;p&gt;FLOAM: &lt;a href=&quot;https://github.com/wh200720041/floam&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/wh200720041/floam&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Other remapped parameters for FLOAM:&lt;ul&gt;&lt;li&gt;Icp/VoxelSize -&amp;gt; Resolution of the map&lt;/li&gt;&lt;li&gt;Icp/RangeMax (Max distance: set to 200 if 0)&lt;/li&gt;&lt;li&gt;Icp/RangeMin (Min distance)&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;LOAM: &lt;a href=&quot;https://github.com/laboshinl/loam_velodyne&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/laboshinl/loam_velodyne&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Velodyne input required. Currently tested only with KITTI data set.&lt;/p&gt;&lt;p&gt;FLOAM: &lt;a href=&quot;https://github.com/wh200720041/floam&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/wh200720041/floam&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Other remapped parameters for FLOAM:&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Icp/RangeMax (Max distance: set to 200 if 0)&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Icp/RangeMin (Min distance)&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@@ -16293,7 +16293,78 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout_101" columnstretch="0,1"> <layout class="QGridLayout" name="gridLayout_101" columnstretch="0,1">
<item row="2" column="1"> <item row="4" column="1">
<widget class="QLabel" name="label_476">
<property name="text">
<string>Angular output variance.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QDoubleSpinBox" name="odom_loam_linvar">
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>0.000100000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.000100000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QDoubleSpinBox" name="odom_loam_angvar">
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>0.000100000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.000100000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_474">
<property name="text">
<string>Scan period (s).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="odom_loam_localMapping">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_475"> <widget class="QLabel" name="label_475">
<property name="text"> <property name="text">
<string>Linear output variance.</string> <string>Linear output variance.</string>
@@ -16319,19 +16390,6 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QLabel" name="label_474">
<property name="text">
<string>Scan period (s).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QDoubleSpinBox" name="odom_loam_scan_period"> <widget class="QDoubleSpinBox" name="odom_loam_scan_period">
<property name="minimum"> <property name="minimum">
@@ -16348,6 +16406,19 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1">
<widget class="QLabel" name="label_477">
<property name="text">
<string>Local mapping. It adds more time to compute odometry, but accuracy is significantly improved.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QComboBox" name="odom_loam_sensor"> <widget class="QComboBox" name="odom_loam_sensor">
<property name="sizeAdjustPolicy"> <property name="sizeAdjustPolicy">
@@ -16370,10 +16441,10 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</item> </item>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="2" column="1">
<widget class="QLabel" name="label_476"> <widget class="QLabel" name="label_566">
<property name="text"> <property name="text">
<string>Angular output variance.</string> <string>Map resolution.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@@ -16384,60 +16455,21 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QDoubleSpinBox" name="odom_loam_linvar"> <widget class="QDoubleSpinBox" name="odom_loam_resolution">
<property name="decimals"> <property name="decimals">
<number>4</number> <number>2</number>
</property> </property>
<property name="minimum"> <property name="minimum">
<double>0.000100000000000</double> <double>0.010000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>1.000000000000000</double> <double>9.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.000100000000000</double> <double>0.000100000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>0.500000000000000</double> <double>0.200000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QDoubleSpinBox" name="odom_loam_angvar">
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>0.000100000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.000100000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="odom_loam_localMapping">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_477">
<property name="text">
<string>Local mapping. It adds more time to compute odometry, but accuracy is significantly improved.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>