From 1b5c11f796cb5660b82c90b9c3e7c924f843cf23 Mon Sep 17 00:00:00 2001
From: andreucm <acoromin@iri.upc.edu>
Date: Mon, 24 Oct 2016 15:30:15 +0200
Subject: [PATCH] LandmarkMatch struct removed from wolf.h and declared at
 landmark_match.h file

---
 src/examples/CMakeLists.txt      | 72 ++++++++++++++++----------------
 src/landmark_match.h             | 38 +++++++++++++++++
 src/processor_tracker_landmark.h |  2 +
 src/wolf.h                       | 22 ----------
 4 files changed, 76 insertions(+), 58 deletions(-)
 create mode 100644 src/landmark_match.h

diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index be64828cc..aaee75976 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -148,39 +148,39 @@ TARGET_LINK_LIBRARIES(test_processor_imu ${PROJECT_NAME})
 #    TARGET_LINK_LIBRARIES(test_capture_laser_2D ${PROJECT_NAME})
 #ENDIF (laser_scan_utils_FOUND)
 
-IF(faramotics_FOUND)
-    IF (laser_scan_utils_FOUND)
-        ADD_EXECUTABLE(test_ceres_2_lasers test_ceres_2_lasers.cpp)
-        TARGET_LINK_LIBRARIES(test_ceres_2_lasers
-                                ${pose_state_time_LIBRARIES}
-                                ${faramotics_LIBRARIES}
-                                ${PROJECT_NAME})
-        ADD_EXECUTABLE(test_ceres_2_lasers_polylines test_ceres_2_lasers_polylines.cpp)
-        TARGET_LINK_LIBRARIES(test_ceres_2_lasers_polylines
-                                ${pose_state_time_LIBRARIES}
-                                ${faramotics_LIBRARIES}
-                                ${PROJECT_NAME})
-        ADD_EXECUTABLE(test_2_lasers_offline test_2_lasers_offline.cpp)
-        TARGET_LINK_LIBRARIES(test_2_lasers_offline
-                                ${pose_state_time_LIBRARIES}
-                                ${faramotics_LIBRARIES}
-                                ${PROJECT_NAME})
-        ADD_EXECUTABLE(test_faramotics_simulation test_faramotics_simulation.cpp)
-        TARGET_LINK_LIBRARIES(test_faramotics_simulation
-                                ${pose_state_time_LIBRARIES}
-                                ${faramotics_LIBRARIES}
-                                ${PROJECT_NAME})
-#        ADD_EXECUTABLE(test_autodiff test_autodiff.cpp)
-#        TARGET_LINK_LIBRARIES(test_autodiff
-#                                ${pose_state_time_LIBRARIES}
-#                                ${faramotics_LIBRARIES}
-#                                ${PROJECT_NAME})
-#        IF(Suitesparse_FOUND)
-#            ADD_EXECUTABLE(test_iQR_wolf2 solver/test_iQR_wolf2.cpp)
-#            TARGET_LINK_LIBRARIES(test_iQR_wolf2
-#                                ${pose_state_time_LIBRARIES}
-#                                ${faramotics_LIBRARIES}
-#                                ${PROJECT_NAME})
-#        ENDIF(Suitesparse_FOUND)
-    ENDIF (laser_scan_utils_FOUND)
-ENDIF(faramotics_FOUND)
+# IF(faramotics_FOUND)
+#     IF (laser_scan_utils_FOUND)
+#         ADD_EXECUTABLE(test_ceres_2_lasers test_ceres_2_lasers.cpp)
+#         TARGET_LINK_LIBRARIES(test_ceres_2_lasers
+#                                 ${pose_state_time_LIBRARIES}
+#                                 ${faramotics_LIBRARIES}
+#                                 ${PROJECT_NAME})
+#         ADD_EXECUTABLE(test_ceres_2_lasers_polylines test_ceres_2_lasers_polylines.cpp)
+#         TARGET_LINK_LIBRARIES(test_ceres_2_lasers_polylines
+#                                 ${pose_state_time_LIBRARIES}
+#                                 ${faramotics_LIBRARIES}
+#                                 ${PROJECT_NAME})
+#         ADD_EXECUTABLE(test_2_lasers_offline test_2_lasers_offline.cpp)
+#         TARGET_LINK_LIBRARIES(test_2_lasers_offline
+#                                 ${pose_state_time_LIBRARIES}
+#                                 ${faramotics_LIBRARIES}
+#                                 ${PROJECT_NAME})
+#         ADD_EXECUTABLE(test_faramotics_simulation test_faramotics_simulation.cpp)
+#         TARGET_LINK_LIBRARIES(test_faramotics_simulation
+#                                 ${pose_state_time_LIBRARIES}
+#                                 ${faramotics_LIBRARIES}
+#                                 ${PROJECT_NAME})
+# #        ADD_EXECUTABLE(test_autodiff test_autodiff.cpp)
+# #        TARGET_LINK_LIBRARIES(test_autodiff
+# #                                ${pose_state_time_LIBRARIES}
+# #                                ${faramotics_LIBRARIES}
+# #                                ${PROJECT_NAME})
+# #        IF(Suitesparse_FOUND)
+# #            ADD_EXECUTABLE(test_iQR_wolf2 solver/test_iQR_wolf2.cpp)
+# #            TARGET_LINK_LIBRARIES(test_iQR_wolf2
+# #                                ${pose_state_time_LIBRARIES}
+# #                                ${faramotics_LIBRARIES}
+# #                                ${PROJECT_NAME})
+# #        ENDIF(Suitesparse_FOUND)
+# #     ENDIF (laser_scan_utils_FOUND)
+# # ENDIF(faramotics_FOUND)
diff --git a/src/landmark_match.h b/src/landmark_match.h
new file mode 100644
index 000000000..26b0b6f92
--- /dev/null
+++ b/src/landmark_match.h
@@ -0,0 +1,38 @@
+#ifndef LANDMARK_MATCH_H_
+#define LANDMARK_MATCH_H_
+
+// Wolf includes
+#include "wolf.h"
+
+//wolf nampseace
+namespace wolf {
+    
+/** \brief Match between a feature and a landmark
+ *
+ * Match between a feature and a landmark
+ *
+ **/
+struct LandmarkMatch
+{
+    LandmarkBasePtr landmark_ptr_;
+    Scalar normalized_score_;
+    
+    LandmarkMatch() :
+            landmark_ptr_(nullptr), normalized_score_(0)
+    {
+
+    }
+    LandmarkMatch(LandmarkBasePtr _landmark_ptr, Scalar _normalized_score) :
+            landmark_ptr_(_landmark_ptr), normalized_score_(_normalized_score)
+    {
+
+    }
+};
+
+// Map of Feature - Landmark matches
+typedef std::shared_ptr<LandmarkMatch> LandmarkMatchPtr;
+typedef std::map<FeatureBasePtr, LandmarkMatchPtr> LandmarkMatchMap;
+
+}//end namespace
+
+#endif
diff --git a/src/processor_tracker_landmark.h b/src/processor_tracker_landmark.h
index 96d7c2cbd..5e758c76d 100644
--- a/src/processor_tracker_landmark.h
+++ b/src/processor_tracker_landmark.h
@@ -8,8 +8,10 @@
 #ifndef PROCESSOR_TRACKER_LANDMARK_H_
 #define PROCESSOR_TRACKER_LANDMARK_H_
 
+//wolf includes
 #include "processor_tracker.h"
 #include "capture_base.h"
+#include "landmark_match.h"
 
 namespace wolf
 {
diff --git a/src/wolf.h b/src/wolf.h
index a700a7f90..a25a14955 100644
--- a/src/wolf.h
+++ b/src/wolf.h
@@ -377,28 +377,6 @@ typedef std::shared_ptr<StateQuaternion> StateQuaternionPtr;
 // - - Local Parametrization
 typedef std::shared_ptr<LocalParametrizationBase> LocalParametrizationBasePtr;
 
-// - - Match Feature - Landmark
-struct LandmarkMatch
-{
-        LandmarkBasePtr landmark_ptr_;
-        Scalar normalized_score_;
-        LandmarkMatch() :
-                landmark_ptr_(nullptr), normalized_score_(0)
-        {
-
-        }
-        LandmarkMatch(LandmarkBasePtr _landmark_ptr, Scalar _normalized_score) :
-                landmark_ptr_(_landmark_ptr), normalized_score_(_normalized_score)
-        {
-
-        }
-};
-
-// Match map Feature - Landmark
-typedef std::shared_ptr<LandmarkMatch> LandmarkMatchPtr;
-typedef std::map<FeatureBasePtr, LandmarkMatchPtr> LandmarkMatchMap;
-
-
 // Feature-Feature correspondence
 struct FeatureMatch
 {
-- 
GitLab