From 2b7ac5a1df28661fbc1acb3d15a437aaf6797504 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Thu, 15 Feb 2024 10:51:33 +0100
Subject: [PATCH] Main

---
 .gitlab-ci.yml                                |  6 +-
 CMakeLists.txt                                |  2 +-
 examples/polyline_demo.cpp                    |  2 +-
 include/laser_scan_utils/corner_falko_2d.h    |  2 +-
 include/laser_scan_utils/corner_finder.h      |  2 +-
 .../corner_finder_inscribed_angle.h           |  2 +-
 include/laser_scan_utils/corner_point.h       |  2 +-
 include/laser_scan_utils/grid_2d.h            |  2 +-
 include/laser_scan_utils/grid_cluster.h       |  2 +-
 include/laser_scan_utils/icp.h                |  2 +-
 include/laser_scan_utils/laser_scan.h         |  2 +-
 include/laser_scan_utils/laser_scan_utils.h   |  2 +-
 .../laser_scan_utils/laser_scan_with_params.h |  2 +-
 include/laser_scan_utils/line_finder.h        |  2 +-
 include/laser_scan_utils/line_finder_hough.h  |  2 +-
 .../laser_scan_utils/line_finder_iterative.h  |  2 +-
 .../laser_scan_utils/line_finder_jump_fit.h   |  2 +-
 include/laser_scan_utils/line_segment.h       |  2 +-
 include/laser_scan_utils/loop_closure_base.h  |  2 +-
 include/laser_scan_utils/loop_closure_falko.h |  2 +-
 .../match_loop_closure_scene.h                |  2 +-
 include/laser_scan_utils/point_set.h          |  2 +-
 include/laser_scan_utils/polyline.h           |  2 +-
 include/laser_scan_utils/scan_segment.h       |  2 +-
 include/laser_scan_utils/scene_base.h         |  2 +-
 include/laser_scan_utils/scene_falko.h        |  2 +-
 ...eader_2022.txt => license_header_2024.txt} |  2 +-
 src/corner_falko_2d.cpp                       |  2 +-
 src/corner_finder.cpp                         |  2 +-
 src/corner_finder_inscribed_angle.cpp         |  2 +-
 src/corner_point.cpp                          |  2 +-
 src/grid_2d.cpp                               |  2 +-
 src/grid_cluster.cpp                          |  2 +-
 src/icp.cpp                                   | 24 +++---
 src/laser_scan.cpp                            |  2 +-
 src/laser_scan_with_params.cpp                |  2 +-
 src/line_finder.cpp                           |  2 +-
 src/line_finder_hough.cpp                     |  2 +-
 src/line_finder_iterative.cpp                 |  2 +-
 src/line_finder_jump_fit.cpp                  |  2 +-
 src/line_segment.cpp                          |  2 +-
 src/loop_closure_base.cpp                     |  2 +-
 src/point_set.cpp                             |  2 +-
 src/polyline.cpp                              |  2 +-
 src/scan_segment.cpp                          |  2 +-
 test/CMakeLists.txt                           |  8 +-
 test/data/scan_data.h                         |  2 +-
 test/gtest/CMakeLists.txt                     | 76 +++----------------
 test/gtest/utils_gtest.h                      |  2 +-
 test/gtest_example.cpp                        |  2 +-
 test/gtest_icp.cpp                            |  2 +-
 test/gtest_loop_closure_falko.cpp             |  2 +-
 test/matplotlibcpp.h                          |  2 +-
 53 files changed, 78 insertions(+), 134 deletions(-)
 rename scripts/{license_header_2022.txt => license_header_2024.txt} (88%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 077d37a..2d763fb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -34,9 +34,11 @@ stages:
   - cd $CI_PROJECT_DIR
 
   # configure git
-  - export CI_NEW_BRANCH=ci_processing$RANDOM
+  - if [ `git rev-parse --verify ci_processing 2>/dev/null` ]; then
+  -   git branch --delete ci_processing
+  - fi
+  - export CI_NEW_BRANCH=ci_processing
   - echo creating new temporary branch... $CI_NEW_BRANCH
-  #- export CI_NEW_BRANCH=ci_processing$CI_COMMIT_SHORT_SHA
   - git config --global user.email "${CI_EMAIL}"
   - git config --global user.name "${CI_USERNAME}"
   - git checkout -b $CI_NEW_BRANCH # temporary branch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11db195..c83af3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 # Pre-requisites about cmake itself
-CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
 
 # The project name and the type of project
 PROJECT(laser_scan_utils)
diff --git a/examples/polyline_demo.cpp b/examples/polyline_demo.cpp
index 634f8eb..4bb848c 100644
--- a/examples/polyline_demo.cpp
+++ b/examples/polyline_demo.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/corner_falko_2d.h b/include/laser_scan_utils/corner_falko_2d.h
index 6c951fd..94911a4 100644
--- a/include/laser_scan_utils/corner_falko_2d.h
+++ b/include/laser_scan_utils/corner_falko_2d.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/corner_finder.h b/include/laser_scan_utils/corner_finder.h
index c4a7d3a..fdab44a 100644
--- a/include/laser_scan_utils/corner_finder.h
+++ b/include/laser_scan_utils/corner_finder.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/corner_finder_inscribed_angle.h b/include/laser_scan_utils/corner_finder_inscribed_angle.h
index 65518f4..6f16c9c 100644
--- a/include/laser_scan_utils/corner_finder_inscribed_angle.h
+++ b/include/laser_scan_utils/corner_finder_inscribed_angle.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/corner_point.h b/include/laser_scan_utils/corner_point.h
index 0863751..a85ff03 100644
--- a/include/laser_scan_utils/corner_point.h
+++ b/include/laser_scan_utils/corner_point.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/grid_2d.h b/include/laser_scan_utils/grid_2d.h
index 5da0737..00b6154 100644
--- a/include/laser_scan_utils/grid_2d.h
+++ b/include/laser_scan_utils/grid_2d.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/grid_cluster.h b/include/laser_scan_utils/grid_cluster.h
index be510ba..026b621 100644
--- a/include/laser_scan_utils/grid_cluster.h
+++ b/include/laser_scan_utils/grid_cluster.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/icp.h b/include/laser_scan_utils/icp.h
index 113b23e..71ba967 100644
--- a/include/laser_scan_utils/icp.h
+++ b/include/laser_scan_utils/icp.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/laser_scan.h b/include/laser_scan_utils/laser_scan.h
index 8871fcc..144f031 100644
--- a/include/laser_scan_utils/laser_scan.h
+++ b/include/laser_scan_utils/laser_scan.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/laser_scan_utils.h b/include/laser_scan_utils/laser_scan_utils.h
index 7eb29a6..b055283 100644
--- a/include/laser_scan_utils/laser_scan_utils.h
+++ b/include/laser_scan_utils/laser_scan_utils.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/laser_scan_with_params.h b/include/laser_scan_utils/laser_scan_with_params.h
index 45ab37d..db93fc0 100644
--- a/include/laser_scan_utils/laser_scan_with_params.h
+++ b/include/laser_scan_utils/laser_scan_with_params.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/line_finder.h b/include/laser_scan_utils/line_finder.h
index c2281ae..5696da1 100644
--- a/include/laser_scan_utils/line_finder.h
+++ b/include/laser_scan_utils/line_finder.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/line_finder_hough.h b/include/laser_scan_utils/line_finder_hough.h
index eaf5386..1b4f884 100644
--- a/include/laser_scan_utils/line_finder_hough.h
+++ b/include/laser_scan_utils/line_finder_hough.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/line_finder_iterative.h b/include/laser_scan_utils/line_finder_iterative.h
index 2e04dfe..c68055c 100644
--- a/include/laser_scan_utils/line_finder_iterative.h
+++ b/include/laser_scan_utils/line_finder_iterative.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/line_finder_jump_fit.h b/include/laser_scan_utils/line_finder_jump_fit.h
index d967615..ed3acb1 100644
--- a/include/laser_scan_utils/line_finder_jump_fit.h
+++ b/include/laser_scan_utils/line_finder_jump_fit.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/line_segment.h b/include/laser_scan_utils/line_segment.h
index bd03fa8..6b5b28a 100644
--- a/include/laser_scan_utils/line_segment.h
+++ b/include/laser_scan_utils/line_segment.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/loop_closure_base.h b/include/laser_scan_utils/loop_closure_base.h
index 1bd342b..f509f86 100644
--- a/include/laser_scan_utils/loop_closure_base.h
+++ b/include/laser_scan_utils/loop_closure_base.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/loop_closure_falko.h b/include/laser_scan_utils/loop_closure_falko.h
index 52559da..c5b3e1d 100644
--- a/include/laser_scan_utils/loop_closure_falko.h
+++ b/include/laser_scan_utils/loop_closure_falko.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/match_loop_closure_scene.h b/include/laser_scan_utils/match_loop_closure_scene.h
index 96e0cd6..9805393 100644
--- a/include/laser_scan_utils/match_loop_closure_scene.h
+++ b/include/laser_scan_utils/match_loop_closure_scene.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/point_set.h b/include/laser_scan_utils/point_set.h
index 516efd5..1dc8b8e 100644
--- a/include/laser_scan_utils/point_set.h
+++ b/include/laser_scan_utils/point_set.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/polyline.h b/include/laser_scan_utils/polyline.h
index 7769a2a..03012f6 100644
--- a/include/laser_scan_utils/polyline.h
+++ b/include/laser_scan_utils/polyline.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/scan_segment.h b/include/laser_scan_utils/scan_segment.h
index 39bad35..21520f7 100644
--- a/include/laser_scan_utils/scan_segment.h
+++ b/include/laser_scan_utils/scan_segment.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/scene_base.h b/include/laser_scan_utils/scene_base.h
index b53bd00..cb3d222 100644
--- a/include/laser_scan_utils/scene_base.h
+++ b/include/laser_scan_utils/scene_base.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/include/laser_scan_utils/scene_falko.h b/include/laser_scan_utils/scene_falko.h
index b341c80..9719b46 100644
--- a/include/laser_scan_utils/scene_falko.h
+++ b/include/laser_scan_utils/scene_falko.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/scripts/license_header_2022.txt b/scripts/license_header_2024.txt
similarity index 88%
rename from scripts/license_header_2022.txt
rename to scripts/license_header_2024.txt
index 2e6616c..79c7f8e 100644
--- a/scripts/license_header_2022.txt
+++ b/scripts/license_header_2024.txt
@@ -1,4 +1,4 @@
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/corner_falko_2d.cpp b/src/corner_falko_2d.cpp
index 3b98f1e..1b49e33 100644
--- a/src/corner_falko_2d.cpp
+++ b/src/corner_falko_2d.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/corner_finder.cpp b/src/corner_finder.cpp
index d4d5f6d..023b6cd 100644
--- a/src/corner_finder.cpp
+++ b/src/corner_finder.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/corner_finder_inscribed_angle.cpp b/src/corner_finder_inscribed_angle.cpp
index 3783b8d..5e8d7e4 100644
--- a/src/corner_finder_inscribed_angle.cpp
+++ b/src/corner_finder_inscribed_angle.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/corner_point.cpp b/src/corner_point.cpp
index d966f38..ebc5338 100644
--- a/src/corner_point.cpp
+++ b/src/corner_point.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/grid_2d.cpp b/src/grid_2d.cpp
index b4dff7e..a9cafde 100644
--- a/src/grid_2d.cpp
+++ b/src/grid_2d.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/grid_cluster.cpp b/src/grid_cluster.cpp
index 17168cf..aa12943 100644
--- a/src/grid_cluster.cpp
+++ b/src/grid_cluster.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/icp.cpp b/src/icp.cpp
index 1e60fbc..354a905 100644
--- a/src/icp.cpp
+++ b/src/icp.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
@@ -165,9 +165,9 @@ icpOutput ICP::align(const LaserScan &_current_ls,
 
     if (result.valid)
     {
-        result.res_transf(0) = csm_output.x[0];//*_current_scan_params.range_max_/100;
-        result.res_transf(1) = csm_output.x[1];//*_current_scan_params.range_max_/100;
-        result.res_transf(2) = csm_output.x[2];//*_current_scan_params.range_max_/100;
+        result.res_transf(0) = csm_output.x[0];
+        result.res_transf(1) = csm_output.x[1];
+        result.res_transf(2) = csm_output.x[2];
 
         if (csm_input.do_compute_covariance)
         {
@@ -176,21 +176,21 @@ icpOutput ICP::align(const LaserScan &_current_ls,
                     result.res_covar(i, j) = _icp_params.cov_factor *
                     csm_output.cov_x_m->data[i * csm_output.cov_x_m->tda + j];
             
-            // Multiply variance in bigger eigenvalue direction
-            if (abs(_icp_params.cov_factor - 1) > 1e3)
+            // Grow covariance in the biggest eigenvalue direction
+            if (_icp_params.cov_max_eigv_factor - 1 > 1e-6)
             {
-                Eigen::SelfAdjointEigenSolver<Eigen::Matrix3d> eigensolver(result.res_covar);
+                Eigen::SelfAdjointEigenSolver<Eigen::Matrix2d> eigensolver(result.res_covar.topLeftCorner<2,2>());
 
                 if (eigensolver.info() == Eigen::Success)
                 {
-                    Eigen::Vector3d eigvs = eigensolver.eigenvalues();
+                    Eigen::Vector2d eigvs = eigensolver.eigenvalues();
                     Eigen::Index maxRow, maxCol;
                     float max_eigv = eigvs.maxCoeff(&maxRow, &maxCol);
 
-                    eigvs(maxRow) = _icp_params.cov_factor * max_eigv;
-                    result.res_covar = eigensolver.eigenvectors() *
-                                       eigvs.asDiagonal() *
-                                       eigensolver.eigenvectors().transpose();
+                    eigvs(maxRow) = _icp_params.cov_max_eigv_factor * max_eigv;
+                    result.res_covar.topLeftCorner<2,2>() = eigensolver.eigenvectors() *
+                                                            eigvs.asDiagonal() *
+                                                            eigensolver.eigenvectors().transpose();
                 }
             }
         }
diff --git a/src/laser_scan.cpp b/src/laser_scan.cpp
index 2827e90..18a0cb2 100644
--- a/src/laser_scan.cpp
+++ b/src/laser_scan.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/laser_scan_with_params.cpp b/src/laser_scan_with_params.cpp
index 8e5ce0d..7bfe8b2 100644
--- a/src/laser_scan_with_params.cpp
+++ b/src/laser_scan_with_params.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/line_finder.cpp b/src/line_finder.cpp
index 418a404..964482a 100644
--- a/src/line_finder.cpp
+++ b/src/line_finder.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/line_finder_hough.cpp b/src/line_finder_hough.cpp
index 930015c..79a2e3c 100644
--- a/src/line_finder_hough.cpp
+++ b/src/line_finder_hough.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/line_finder_iterative.cpp b/src/line_finder_iterative.cpp
index d83e5ee..bd6150c 100644
--- a/src/line_finder_iterative.cpp
+++ b/src/line_finder_iterative.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/line_finder_jump_fit.cpp b/src/line_finder_jump_fit.cpp
index 38a1ea7..614049c 100644
--- a/src/line_finder_jump_fit.cpp
+++ b/src/line_finder_jump_fit.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/line_segment.cpp b/src/line_segment.cpp
index a5c9c89..66d3a55 100644
--- a/src/line_segment.cpp
+++ b/src/line_segment.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/loop_closure_base.cpp b/src/loop_closure_base.cpp
index 177a7b8..68c76bf 100644
--- a/src/loop_closure_base.cpp
+++ b/src/loop_closure_base.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/point_set.cpp b/src/point_set.cpp
index a20fb16..80b1eb2 100644
--- a/src/point_set.cpp
+++ b/src/point_set.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/polyline.cpp b/src/polyline.cpp
index 28bc1d6..75e1ab8 100644
--- a/src/polyline.cpp
+++ b/src/polyline.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/src/scan_segment.cpp b/src/scan_segment.cpp
index 94b81a4..7abb6ea 100644
--- a/src/scan_segment.cpp
+++ b/src/scan_segment.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 3234bd9..da699ec 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,18 +4,18 @@ add_subdirectory(gtest)
 ############# USE THIS TEST AS AN EXAMPLE ####################
 #                                                            #
 # Create a specific test executable for gtest_example        #
-# laser_scan_utils_add_gtest(gtest_example gtest_example.cpp)#
+# add_gtest(gtest_example gtest_example.cpp)#
 #                                                            #
 ##############################################################
 
 # gtest example
-laser_scan_utils_add_gtest(gtest_example gtest_example.cpp)
+add_gtest(gtest_example gtest_example.cpp)
 
 # gtest icp
 IF(csm_FOUND)
-	laser_scan_utils_add_gtest(gtest_icp gtest_icp.cpp)
+	add_gtest(gtest_icp gtest_icp.cpp)
 ENDIF(csm_FOUND)
 
 IF(falkolib_FOUND)
-	laser_scan_utils_add_gtest(gtest_loop_closure_falko gtest_loop_closure_falko.cpp)
+	add_gtest(gtest_loop_closure_falko gtest_loop_closure_falko.cpp)
 ENDIF(falkolib_FOUND)
\ No newline at end of file
diff --git a/test/data/scan_data.h b/test/data/scan_data.h
index 46516f6..4c48f05 100644
--- a/test/data/scan_data.h
+++ b/test/data/scan_data.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/gtest/CMakeLists.txt b/test/gtest/CMakeLists.txt
index 00fa077..3b52f51 100644
--- a/test/gtest/CMakeLists.txt
+++ b/test/gtest/CMakeLists.txt
@@ -1,73 +1,15 @@
-if(${CMAKE_VERSION} VERSION_LESS "3.11.0") 
-  message("CMake version less than 3.11.0")
+include(FetchContent)
 
-  # Enable ExternalProject CMake module
-  include(ExternalProject)
+FetchContent_Declare(
+  googletest
+  GIT_REPOSITORY https://github.com/google/googletest.git 
+  GIT_TAG main)
 
-  set(GTEST_FORCE_SHARED_CRT ON)
-  set(GTEST_DISABLE_PTHREADS ON) # without this in ubuntu 18.04 we get linking errors
+SET(INSTALL_GTEST OFF) # Disable installation of googletest
+FetchContent_MakeAvailable(googletest)
 
-  # Download GoogleTest
-  ExternalProject_Add(googletest
-      GIT_REPOSITORY https://github.com/google/googletest.git
-      GIT_TAG        v1.8.x
-      # TIMEOUT 1 # We'll try this
-      CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
-      -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
-      -DCMAKE_CXX_FLAGS=${MSVC_COMPILER_DEFS}
-      -Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
-      -Dgtest_disable_pthreads=${GTEST_DISABLE_PTHREADS}
-      -DBUILD_GTEST=ON
-      PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
-      # Disable install step
-      INSTALL_COMMAND ""
-      UPDATE_DISCONNECTED 1 # 1: do not update googletest; 0: update googletest via github
-  )
-
-  # Get GTest source and binary directories from CMake project
-
-  # Specify include dir
-  ExternalProject_Get_Property(googletest source_dir)
-  set(GTEST_INCLUDE_DIRS ${source_dir}/googletest/include PARENT_SCOPE)
-
-  # Specify MainTest's link libraries
-  ExternalProject_Get_Property(googletest binary_dir)
-  set(GTEST_LIBS_DIR ${binary_dir}/googlemock/gtest PARENT_SCOPE)
-
-  # Create a libgtest target to be used as a dependency by test programs
-  add_library(libgtest IMPORTED STATIC GLOBAL)
-  add_dependencies(libgtest googletest)
-
-  # Set libgtest properties
-  set_target_properties(libgtest PROPERTIES
-      "IMPORTED_LOCATION" "${binary_dir}/googlemock/gtest/libgtest.a"
-      "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
-  )
-
-else()
-
-  message("CMake version equal or greater than 3.11.0")
-
-  include(FetchContent)
-
-  FetchContent_Declare(
-    googletest
-    GIT_REPOSITORY https://github.com/google/googletest.git 
-    GIT_TAG v1.8.x)
-
-  SET(INSTALL_GTEST OFF) # Disable installation of googletest
-  FetchContent_MakeAvailable(googletest)
-
-endif()
-  
-function(laser_scan_utils_add_gtest target)
+function(add_gtest target)
   add_executable(${target} ${ARGN})
-  if(${CMAKE_VERSION} VERSION_LESS "3.11.0") 
-    add_dependencies(${target} libgtest)
-    target_link_libraries(${target} PUBLIC libgtest ${PROJECT_NAME})
-    target_include_directories(${target} PUBLIC ${GTEST_INCLUDE_DIRS})
-  else()
-    target_link_libraries(${target} PUBLIC gtest_main ${PROJECT_NAME})
-  endif()
+  target_link_libraries(${target} PUBLIC gtest_main ${PROJECT_NAME})
   add_test(NAME ${target} COMMAND ${target})
 endfunction()
diff --git a/test/gtest/utils_gtest.h b/test/gtest/utils_gtest.h
index cdc9cf0..15ab238 100644
--- a/test/gtest/utils_gtest.h
+++ b/test/gtest/utils_gtest.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/gtest_example.cpp b/test/gtest_example.cpp
index f2258b6..3fd271c 100644
--- a/test/gtest_example.cpp
+++ b/test/gtest_example.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/gtest_icp.cpp b/test/gtest_icp.cpp
index 481f367..e3ec9b4 100644
--- a/test/gtest_icp.cpp
+++ b/test/gtest_icp.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/gtest_loop_closure_falko.cpp b/test/gtest_loop_closure_falko.cpp
index 56be534..6225f5f 100644
--- a/test/gtest_loop_closure_falko.cpp
+++ b/test/gtest_loop_closure_falko.cpp
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
diff --git a/test/matplotlibcpp.h b/test/matplotlibcpp.h
index cd41047..c1b2d9b 100644
--- a/test/matplotlibcpp.h
+++ b/test/matplotlibcpp.h
@@ -1,6 +1,6 @@
 //--------LICENSE_START--------
 //
-// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
 // Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu)
 // All rights reserved.
 //
-- 
GitLab