From ffbed96cc1a5184de88e8ad43142ade63ced954c Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Wed, 22 Dec 2021 12:37:15 +0100
Subject: [PATCH] undef CSM macros interfering with std

---
 src/icp.h | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/icp.h b/src/icp.h
index d93e738..0b0863d 100644
--- a/src/icp.h
+++ b/src/icp.h
@@ -26,29 +26,27 @@
 #include <chrono>
 #include <random>
 #include <csm/csm_all.h>
-// using namespace CSM;
+#undef max //undefine macro of csm that may interfere with std::max
+#undef min //undefine macro of csm that may interfere with std::min
 
 namespace laserscanutils{
 
 struct icpOutput{
-    bool valid; /** if the result is valid */
-    Eigen::Vector3s res_transf;
-    Eigen::Matrix3s res_covar;
-    int nvalid;     /** Number of valid correspondence in the end */
-    double error;   	/** Total correspondence error */
+    bool valid;                 // If the result is valid
+    Eigen::Vector3s res_transf; // Transformation found
+    Eigen::Matrix3s res_covar;  // Covariance of the transformation
+    int nvalid;                 // Number of valid correspondences in the match
+    double error;   	        // Total correspondence error
 };
 
 struct icpParams
 {
-    bool verbose;                       // prints debug messages
+    bool verbose; // prints debug messages
 
     // Algorithm options ---------------------------------------------------
     bool use_point_to_line_distance;     // use PlICP (true) or use vanilla ICP (false).
-
-    /** Maximum angular displacement between scans (deg)*/
-    double max_angular_correction_deg;
-    /** Maximum translation between scans (m) */
-    double max_linear_correction;
+    double max_angular_correction_deg;   // Maximum angular displacement between scans (deg)
+    double max_linear_correction;        // Maximum translation between scans (m)
 
     // Stopping criteria
     int max_iterations;     // maximum iterations
@@ -63,12 +61,12 @@ struct icpParams
     bool debug_verify_tricks;
 
     // Restart algorithm
-    bool restart;
+    bool restart;                        // Enable restarting
     double restart_threshold_mean_error; // Threshold for restarting
     double restart_dt;                   // Displacement for restarting
     double restart_dtheta;               // Displacement for restarting
 
-    // Discarding points or correpondences ---------------------------------------------------
+    // Discarding points or correspondences ---------------------------------------------------
     /** discard rays outside of this interval */
     double min_reading, max_reading;
     /** Percentage of correspondences to consider: if 0.9,
-- 
GitLab