From d754a078b01020a476514a43d76a08c74ee9fe4e Mon Sep 17 00:00:00 2001
From: Sergi Pujol <sergi.pujol.badell@estudiantat.upc.edu>
Date: Tue, 20 Apr 2021 13:51:22 +0200
Subject: [PATCH] doxygen comments added

---
 src/loop_closure_base.h  | 60 ++++++++++++++++++++--------------------
 src/loop_closure_falko.h | 12 ++++++--
 2 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/src/loop_closure_base.h b/src/loop_closure_base.h
index fe790cf..b6a815f 100644
--- a/src/loop_closure_base.h
+++ b/src/loop_closure_base.h
@@ -23,41 +23,41 @@ namespace laserscanutils {
 
 /** \brief A 2base class for loop closure using falko library
  */
-class LoopClosureBase2d {
-private:
-public:
-  /** \brief Constructor
-   **/
-  LoopClosureBase2d(){};
+class LoopClosureBase2d
+{
+  private:
+  public:
+    /** \brief Constructor
+     **/
+    LoopClosureBase2d(){};
 
-  /** \brief Destructor
-   **/
-  ~LoopClosureBase2d(){};
+    /** \brief Destructor
+     **/
+    ~LoopClosureBase2d(){};
 
-  /** \brief update the scene struct with keypoints and descriptors
-   **/
-  virtual sceneBasePtr extractScene(const LaserScan &scan,
-                                    const LaserScanParams &scanParams) = 0;
+    /** \brief update the scene struct with keypoints and descriptors
+     **/
+    virtual sceneBasePtr extractScene(const LaserScan &scan, const LaserScanParams &scanParams) = 0;
 
-  /** \brief Create and update a matchLoopClosure struct with the info that is
-   *produced when matching two given scenes
-   **/
-  virtual MatchLoopClosureScenePtr matchScene(sceneBasePtr _scene1,
-                                         sceneBasePtr _scene2) = 0;
+    /** \brief Create and update a matchLoopClosure struct with the info that is
+     *produced when matching two given scenes
+     **/
+    virtual MatchLoopClosureScenePtr matchScene(sceneBasePtr _scene1, sceneBasePtr _scene2) = 0;
 
-  /** \brief compare new scans against the trained set in order to find loop
-   *closures
-   **/
-  virtual std::map<double, MatchLoopClosureScenePtr>
-  findLoopClosure(std::list<std::shared_ptr<SceneBase>> _l_scenes,
-                  const sceneBasePtr _new_scene) {
-    std::map<double, MatchLoopClosureScenePtr> matchings;
-    for (auto ref_scene : _l_scenes) {
-      auto match = matchScene(ref_scene, _new_scene);
-      matchings.emplace(match->score, match);
+    /** \brief It matches a target scene against a list of references scenes in order to find loop
+     * closures
+     **/
+    virtual std::map<double, MatchLoopClosureScenePtr> findLoopClosure(std::list<std::shared_ptr<SceneBase>> _l_scenes,
+                                                                       const sceneBasePtr                    _new_scene)
+    {
+        std::map<double, MatchLoopClosureScenePtr> matchings;
+        for (auto ref_scene : _l_scenes)
+            {
+                auto match = matchScene(ref_scene, _new_scene);
+                matchings.emplace(match->score, match);
+            }
+        return matchings;
     }
-    return matchings;
-  }
 };
 } /* namespace laserscanutils */
 
diff --git a/src/loop_closure_falko.h b/src/loop_closure_falko.h
index bb0c1cc..5b177d4 100644
--- a/src/loop_closure_falko.h
+++ b/src/loop_closure_falko.h
@@ -80,9 +80,18 @@ struct ParameterLoopClosureFalko
     double thetaAbsMax_ = 1.57;
 };
 
-/** \brief A base class for loop closure using falko library
+/** \brief A class for loop closure using falko library
+ * 
  * The class is a wrapper of the falkolib that is designed to be used for loop closures in the wolf problem
+ * 
+ * It extracts scenes from a laserscanutils::LaserScan. The scenes contain keypoints and descriptors
+ * 
+ * It matches a target scene against a list of reference scenes.
+ * 
+ * The reference scenes are found from a search of the previous captures
+ * 
  * Diferent types of descriptors can be used, and are specified as template parameters.
+ * 
  * \tparam D Descriptor type. <bsc> or <cgh>
  * \tparam Extr descriptor extractor type <bscExtractor> or <cghExtractor>
  * \tparam M Matcher type <nn_matcher> or <aht_matcher>
@@ -198,7 +207,6 @@ class LoopClosureFalko : public LoopClosureBase2d, public falkolib::FALKOExtract
         new_match->transform_vector.head(2) = new_match->transform.translation();
         new_match->transform_vector(2)      = Eigen::Rotation2Dd(new_match->transform.rotation()).angle();
 
-        //}
         return new_match;
     }
 
-- 
GitLab