0.19.5: added Icp/RangeMin and Icp/RangeMax parameters

This commit is contained in:
matlabbe
2019-08-01 16:21:01 -04:00
parent 487caab349
commit 6767c2ade2
6 changed files with 101 additions and 24 deletions

View File

@@ -21,7 +21,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
####################### #######################
SET(RTABMAP_MAJOR_VERSION 0) SET(RTABMAP_MAJOR_VERSION 0)
SET(RTABMAP_MINOR_VERSION 19) SET(RTABMAP_MINOR_VERSION 19)
SET(RTABMAP_PATCH_VERSION 4) SET(RTABMAP_PATCH_VERSION 5)
SET(RTABMAP_VERSION SET(RTABMAP_VERSION
${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION}) ${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION})

View File

@@ -608,6 +608,8 @@ class RTABMAP_EXP Parameters
RTABMAP_PARAM(Icp, MaxRotation, float, 0.78, "Maximum ICP rotation correction accepted (rad)."); RTABMAP_PARAM(Icp, MaxRotation, float, 0.78, "Maximum ICP rotation correction accepted (rad).");
RTABMAP_PARAM(Icp, VoxelSize, float, 0.0, "Uniform sampling voxel size (0=disabled)."); RTABMAP_PARAM(Icp, VoxelSize, float, 0.0, "Uniform sampling voxel size (0=disabled).");
RTABMAP_PARAM(Icp, DownsamplingStep, int, 1, "Downsampling step size (1=no sampling). This is done before uniform sampling."); RTABMAP_PARAM(Icp, DownsamplingStep, int, 1, "Downsampling step size (1=no sampling). This is done before uniform sampling.");
RTABMAP_PARAM(Icp, RangeMin, float, 0, "Minimum range filtering (0=disabled).");
RTABMAP_PARAM(Icp, RangeMax, float, 0, "Maximum range filtering (0=disabled).");
#ifdef RTABMAP_POINTMATCHER #ifdef RTABMAP_POINTMATCHER
RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.1, "Max distance for point correspondences."); RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.1, "Max distance for point correspondences.");
#else #else

View File

@@ -60,6 +60,8 @@ private:
float _maxRotation; float _maxRotation;
float _voxelSize; float _voxelSize;
int _downsamplingStep; int _downsamplingStep;
float _rangeMin;
float _rangeMax;
float _maxCorrespondenceDistance; float _maxCorrespondenceDistance;
int _maxIterations; int _maxIterations;
float _epsilon; float _epsilon;

View File

@@ -368,6 +368,8 @@ RegistrationIcp::RegistrationIcp(const ParametersMap & parameters, Registration
_maxRotation(Parameters::defaultIcpMaxRotation()), _maxRotation(Parameters::defaultIcpMaxRotation()),
_voxelSize(Parameters::defaultIcpVoxelSize()), _voxelSize(Parameters::defaultIcpVoxelSize()),
_downsamplingStep(Parameters::defaultIcpDownsamplingStep()), _downsamplingStep(Parameters::defaultIcpDownsamplingStep()),
_rangeMin(Parameters::defaultIcpRangeMin()),
_rangeMax(Parameters::defaultIcpRangeMax()),
_maxCorrespondenceDistance(Parameters::defaultIcpMaxCorrespondenceDistance()), _maxCorrespondenceDistance(Parameters::defaultIcpMaxCorrespondenceDistance()),
_maxIterations(Parameters::defaultIcpIterations()), _maxIterations(Parameters::defaultIcpIterations()),
_epsilon(Parameters::defaultIcpEpsilon()), _epsilon(Parameters::defaultIcpEpsilon()),
@@ -401,6 +403,8 @@ void RegistrationIcp::parseParameters(const ParametersMap & parameters)
Parameters::parse(parameters, Parameters::kIcpMaxRotation(), _maxRotation); Parameters::parse(parameters, Parameters::kIcpMaxRotation(), _maxRotation);
Parameters::parse(parameters, Parameters::kIcpVoxelSize(), _voxelSize); Parameters::parse(parameters, Parameters::kIcpVoxelSize(), _voxelSize);
Parameters::parse(parameters, Parameters::kIcpDownsamplingStep(), _downsamplingStep); Parameters::parse(parameters, Parameters::kIcpDownsamplingStep(), _downsamplingStep);
Parameters::parse(parameters, Parameters::kIcpRangeMin(), _rangeMin);
Parameters::parse(parameters, Parameters::kIcpRangeMax(), _rangeMax);
Parameters::parse(parameters, Parameters::kIcpMaxCorrespondenceDistance(), _maxCorrespondenceDistance); Parameters::parse(parameters, Parameters::kIcpMaxCorrespondenceDistance(), _maxCorrespondenceDistance);
Parameters::parse(parameters, Parameters::kIcpIterations(), _maxIterations); Parameters::parse(parameters, Parameters::kIcpIterations(), _maxIterations);
Parameters::parse(parameters, Parameters::kIcpEpsilon(), _epsilon); Parameters::parse(parameters, Parameters::kIcpEpsilon(), _epsilon);
@@ -569,11 +573,11 @@ Transform RegistrationIcp::computeTransformationImpl(
// ICP with guess transform // ICP with guess transform
LaserScan fromScan = dataFrom.laserScanRaw(); LaserScan fromScan = dataFrom.laserScanRaw();
LaserScan toScan = dataTo.laserScanRaw(); LaserScan toScan = dataTo.laserScanRaw();
if(_downsamplingStep>1) if(_downsamplingStep>1 || _rangeMin >0.0f || _rangeMax > 0.0f)
{ {
fromScan = util3d::downsample(fromScan, _downsamplingStep); fromScan = util3d::commonFiltering(fromScan, _downsamplingStep, _rangeMin, _rangeMax);
toScan = util3d::downsample(toScan, _downsamplingStep); toScan = util3d::commonFiltering(toScan, _downsamplingStep, _rangeMin, _rangeMax);
UDEBUG("Downsampling time (step=%d) = %f s", _downsamplingStep, timer.ticks()); UDEBUG("Downsampling and/or range filtering time (step=%d, min=%fm, max=%fm) = %f s", _downsamplingStep, _rangeMin, _rangeMax, timer.ticks());
} }
if(fromScan.size() && toScan.size()) if(fromScan.size() && toScan.size())

View File

@@ -1014,6 +1014,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->globalDetection_icpMaxRotation->setObjectName(Parameters::kIcpMaxRotation().c_str()); _ui->globalDetection_icpMaxRotation->setObjectName(Parameters::kIcpMaxRotation().c_str());
_ui->loopClosure_icpVoxelSize->setObjectName(Parameters::kIcpVoxelSize().c_str()); _ui->loopClosure_icpVoxelSize->setObjectName(Parameters::kIcpVoxelSize().c_str());
_ui->loopClosure_icpDownsamplingStep->setObjectName(Parameters::kIcpDownsamplingStep().c_str()); _ui->loopClosure_icpDownsamplingStep->setObjectName(Parameters::kIcpDownsamplingStep().c_str());
_ui->loopClosure_icpRangeMin->setObjectName(Parameters::kIcpRangeMin.c_str());
_ui->loopClosure_icpRangeMax->setObjectName(Parameters::kIcpRangeMax.c_str());
_ui->loopClosure_icpMaxCorrespondenceDistance->setObjectName(Parameters::kIcpMaxCorrespondenceDistance().c_str()); _ui->loopClosure_icpMaxCorrespondenceDistance->setObjectName(Parameters::kIcpMaxCorrespondenceDistance().c_str());
_ui->loopClosure_icpIterations->setObjectName(Parameters::kIcpIterations().c_str()); _ui->loopClosure_icpIterations->setObjectName(Parameters::kIcpIterations().c_str());
_ui->loopClosure_icpEpsilon->setObjectName(Parameters::kIcpEpsilon().c_str()); _ui->loopClosure_icpEpsilon->setObjectName(Parameters::kIcpEpsilon().c_str());

View File

@@ -64,8 +64,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>677</width> <width>680</width>
<height>2974</height> <height>3082</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>5</number> <number>22</number>
</property> </property>
<widget class="QWidget" name="page_22"> <widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1"> <layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
@@ -17539,7 +17539,7 @@ Lower the ratio -&gt; higher the precision.</string>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout_48" columnstretch="0,1"> <layout class="QGridLayout" name="gridLayout_48" columnstretch="0,1">
<item row="4" column="0"> <item row="6" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpMaxCorrespondenceDistance"> <widget class="QDoubleSpinBox" name="loopClosure_icpMaxCorrespondenceDistance">
<property name="decimals"> <property name="decimals">
<number>3</number> <number>3</number>
@@ -17587,14 +17587,14 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0"> <item row="12" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpPointToPlaneNormalsRadius"> <widget class="QDoubleSpinBox" name="loopClosure_icpPointToPlaneNormalsRadius">
<property name="singleStep"> <property name="singleStep">
<double>0.010000000000000</double> <double>0.010000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="10" column="0">
<widget class="QCheckBox" name="loopClosure_icpPointToPlane"> <widget class="QCheckBox" name="loopClosure_icpPointToPlane">
<property name="text"> <property name="text">
<string/> <string/>
@@ -17614,7 +17614,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="6" column="1">
<widget class="QLabel" name="label_122"> <widget class="QLabel" name="label_122">
<property name="text"> <property name="text">
<string>Max distance for point correspondences.</string> <string>Max distance for point correspondences.</string>
@@ -17640,7 +17640,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="9" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpRatio"> <widget class="QDoubleSpinBox" name="loopClosure_icpRatio">
<property name="minimum"> <property name="minimum">
<double>0.000000000000000</double> <double>0.000000000000000</double>
@@ -17656,7 +17656,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="9" column="1">
<widget class="QLabel" name="label_133"> <widget class="QLabel" name="label_133">
<property name="text"> <property name="text">
<string>Ratio of matching correspondences to accept the transform. If the maximum laser scans is set, this is the minimum ratio of correspondences on laser scan maximum size to accept the transform.</string> <string>Ratio of matching correspondences to accept the transform. If the maximum laser scans is set, this is the minimum ratio of correspondences on laser scan maximum size to accept the transform.</string>
@@ -17669,7 +17669,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="11" column="1">
<widget class="QLabel" name="label_212"> <widget class="QLabel" name="label_212">
<property name="text"> <property name="text">
<string>Number of neighbors to compute normals for point to plane. Normals won't be recomputed if uniform sampling is disabled and that there are already normals in the laser scans.</string> <string>Number of neighbors to compute normals for point to plane. Normals won't be recomputed if uniform sampling is disabled and that there are already normals in the laser scans.</string>
@@ -17682,7 +17682,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0"> <item row="11" column="0">
<widget class="QSpinBox" name="loopClosure_icpPointToPlaneNormals"> <widget class="QSpinBox" name="loopClosure_icpPointToPlaneNormals">
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
@@ -17714,7 +17714,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="7" column="1">
<widget class="QLabel" name="label_124"> <widget class="QLabel" name="label_124">
<property name="text"> <property name="text">
<string>Max iterations.</string> <string>Max iterations.</string>
@@ -17727,7 +17727,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="7" column="0">
<widget class="QSpinBox" name="loopClosure_icpIterations"> <widget class="QSpinBox" name="loopClosure_icpIterations">
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
@@ -17791,7 +17791,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="10" column="1">
<widget class="QLabel" name="label_144"> <widget class="QLabel" name="label_144">
<property name="text"> <property name="text">
<string>Point to plane ICP.</string> <string>Point to plane ICP.</string>
@@ -17804,7 +17804,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="8" column="1">
<widget class="QLabel" name="label_136"> <widget class="QLabel" name="label_136">
<property name="text"> <property name="text">
<string>Set the transformation epsilon (maximum allowable difference between two consecutive transformations) in order for an optimization to be considered as having converged to the final solution.</string> <string>Set the transformation epsilon (maximum allowable difference between two consecutive transformations) in order for an optimization to be considered as having converged to the final solution.</string>
@@ -17817,7 +17817,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="8" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpEpsilon"> <widget class="QDoubleSpinBox" name="loopClosure_icpEpsilon">
<property name="suffix"> <property name="suffix">
<string> m</string> <string> m</string>
@@ -17839,7 +17839,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1"> <item row="12" column="1">
<widget class="QLabel" name="label_426"> <widget class="QLabel" name="label_426">
<property name="text"> <property name="text">
<string>Search radius to compute normals for point to plane. Normals won't be recomputed if uniform sampling is disabled and that there are already normals in the laser scans.</string> <string>Search radius to compute normals for point to plane. Normals won't be recomputed if uniform sampling is disabled and that there are already normals in the laser scans.</string>
@@ -17852,7 +17852,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1"> <item row="13" column="1">
<widget class="QLabel" name="label_429"> <widget class="QLabel" name="label_429">
<property name="text"> <property name="text">
<string>Minimum structural complexity (0.0=low, 1.0=high) of the scan to do point to plane registration, otherwise point to point registration is done instead.</string> <string>Minimum structural complexity (0.0=low, 1.0=high) of the scan to do point to plane registration, otherwise point to point registration is done instead.</string>
@@ -17865,7 +17865,7 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0"> <item row="13" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpPointToPlaneNormalsMinComplexity"> <widget class="QDoubleSpinBox" name="loopClosure_icpPointToPlaneNormalsMinComplexity">
<property name="decimals"> <property name="decimals">
<number>3</number> <number>3</number>
@@ -17878,6 +17878,73 @@ Lower the ratio -&gt; higher the precision.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QDoubleSpinBox" name="loopClosure_icpRangeMin">
<property name="suffix">
<string> m</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_559">
<property name="text">
<string>Minimum range filtering. Set to 0 to disable.</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="1">
<widget class="QLabel" name="label_560">
<property name="text">
<string>Maximum range filtering. Set to 0 to disable.</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="QDoubleSpinBox" name="loopClosure_icpRangeMax">
<property name="suffix">
<string> m</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>