Added Icp/ReciprocalCorrespondences (new default true)

This commit is contained in:
matlabbe
2023-04-06 20:57:35 -07:00
parent 141f2d3334
commit 8b8a512cbb
8 changed files with 396 additions and 359 deletions

View File

@@ -663,7 +663,8 @@ class RTABMAP_CORE_EXPORT Parameters
#else
RTABMAP_PARAM(Icp, MaxCorrespondenceDistance, float, 0.05, "Max distance for point correspondences.");
#endif
RTABMAP_PARAM(Icp, Iterations, int, 30, "Max iterations.");
RTABMAP_PARAM(Icp, ReciprocalCorrespondences, bool, true, "To be a valid correspondence, the corresponding point in target cloud to point in source cloud should be both their closest closest correspondence.");
RTABMAP_PARAM(Icp, Iterations, int, 30, "Max iterations.");
RTABMAP_PARAM(Icp, Epsilon, float, 0, "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.");
RTABMAP_PARAM(Icp, CorrespondenceRatio, float, 0.1, "Ratio of matching correspondences to accept the transform.");
RTABMAP_PARAM(Icp, Force4DoF, bool, false, uFormat("Limit ICP to x, y, z and yaw DoF. Available if %s > 0.", kIcpStrategy().c_str()));

View File

@@ -64,6 +64,7 @@ private:
float _rangeMin;
float _rangeMax;
float _maxCorrespondenceDistance;
bool _reciprocalCorrespondences;
int _maxIterations;
float _epsilon;
float _correspondenceRatio;

View File

@@ -65,26 +65,30 @@ void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
double maxCorrespondenceDistance,
double maxCorrespondenceAngle, // <=0 means that we don't care about normal angle difference
double & variance,
int & correspondencesOut);
int & correspondencesOut,
bool reciprocal);
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloudA,
const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloudB,
double maxCorrespondenceDistance,
double maxCorrespondenceAngle, // <=0 means that we don't care about normal angle difference
double & variance,
int & correspondencesOut);
int & correspondencesOut,
bool reciprocal);
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloudA,
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloudB,
double maxCorrespondenceDistance,
double & variance,
int & correspondencesOut);
int & correspondencesOut,
bool reciprocal);
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloudA,
const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloudB,
double maxCorrespondenceDistance,
double & variance,
int & correspondencesOut);
int & correspondencesOut,
bool reciprocal);
Transform RTABMAP_CORE_EXPORT icp(
const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud_source,