From cb09614a368cb696ef98747e5143c72aae3ef8df Mon Sep 17 00:00:00 2001 From: joanvallve <jvallve@iri.upc.edu> Date: Tue, 2 Jul 2024 12:19:33 +0200 Subject: [PATCH] param name changed --- include/laser_scan_utils/icp.h | 6 +++--- src/icp.cpp | 2 +- test/gtest_icp.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/laser_scan_utils/icp.h b/include/laser_scan_utils/icp.h index be8676c..2d3376f 100644 --- a/include/laser_scan_utils/icp.h +++ b/include/laser_scan_utils/icp.h @@ -42,7 +42,7 @@ namespace laserscanutils double error; // Total correspondence error double mean_error; // Average error (total error / nvalid) double points_ratio; // Ratio of valid correspondences of totall amount of points - unsigned int attempts; // Number of ICP calls to obtain a valid result (<= params.icp_attempts) + unsigned int attempts; // Number of ICP calls to obtain a valid result (<= params.attempts) }; struct icpParams @@ -127,7 +127,7 @@ namespace laserscanutils double cov_max_eigv_factor; // Factor multiplying the direction of the max eigenvalue of the cov output of csm // Attempts ------------------------------------------------------------------ - unsigned int icp_attempts; // number of icp attempts if result fails (not valid or error > restart_threshold_mean_error) + unsigned int attempts; // number of icp attempts if result fails (not valid or error > restart_threshold_mean_error) double perturbation_new_attempts; // perturbation noise amplitude applied to initial guess in new attempts // Validation ---------------------------------------------------------------- @@ -167,7 +167,7 @@ namespace laserscanutils std::cout << "do_compute_covariance: " << std::to_string(do_compute_covariance) << std::endl; std::cout << "cov_factor: " << std::to_string(cov_factor) << std::endl; std::cout << "cov_max_eigv_factor: " << std::to_string(cov_max_eigv_factor) << std::endl; - std::cout << "icp_attempts: " << std::to_string(icp_attempts) << std::endl; + std::cout << "attempts: " << std::to_string(attempts) << std::endl; std::cout << "perturbation_new_attempts: " << std::to_string(perturbation_new_attempts) << std::endl; std::cout << "max_mean_error: " << std::to_string(max_mean_error) << std::endl; std::cout << "min_points_ratio: " << std::to_string(min_points_ratio) << std::endl; diff --git a/src/icp.cpp b/src/icp.cpp index 61aae0d..8909a88 100644 --- a/src/icp.cpp +++ b/src/icp.cpp @@ -208,7 +208,7 @@ icpOutput ICP::align(const LaserScan &_current_ls, std::cout << "Invalid result, trying again!" << std::endl; } - } while (not result.valid and result.attempts < _icp_params.icp_attempts); + } while (not result.valid and result.attempts < _icp_params.attempts); // if valid, copy transformation values and grow covariance if (result.valid) diff --git a/test/gtest_icp.cpp b/test/gtest_icp.cpp index 13dda71..ca66669 100644 --- a/test/gtest_icp.cpp +++ b/test/gtest_icp.cpp @@ -268,7 +268,7 @@ TEST(TestIcp, TestIcpSame1) // icp auto icp_params = icp_params_default; - icp_params.icp_attempts = n_attempts; + icp_params.attempts = n_attempts; // icp_params.verbose = true; // no perturbation @@ -318,7 +318,7 @@ TEST(TestIcp, TestIcpSame2) LaserScanParams scan_params = generateLaserScanParams(0, 1); double pert = 0.0; auto icp_params = icp_params_default; - icp_params.icp_attempts = n_attempts; + icp_params.attempts = n_attempts; for (auto i = 0; i < N; i++) { @@ -375,7 +375,7 @@ TEST(TestIcp, TestIcp1) LaserScan scan_ref, scan_tar; auto icp_params = icp_params_default; - icp_params.icp_attempts = n_attempts; + icp_params.attempts = n_attempts; double pert = 0.0; @@ -421,7 +421,7 @@ TEST(TestIcp, TestIcp10) LaserScan scan_ref, scan_tar; auto icp_params = icp_params_default; - icp_params.icp_attempts = n_attempts; + icp_params.attempts = n_attempts; icp_params.verbose = true; double pert = 0.0; -- GitLab