Skip to content
Snippets Groups Projects
Commit 2213dd70 authored by Sergi Pujol's avatar Sergi Pujol
Browse files

code guide lines

parent bdd5ae6e
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
...@@ -24,16 +24,16 @@ namespace laserscanutils { ...@@ -24,16 +24,16 @@ namespace laserscanutils {
/** \brief A 2base class for loop closure using falko library /** \brief A 2base class for loop closure using falko library
*/ */
class loopClosureBase2d { class LoopClosureBase2d {
private: private:
public: public:
/** \brief Constructor /** \brief Constructor
**/ **/
loopClosureBase2d(){}; LoopClosureBase2d(){};
/** \brief Destructor /** \brief Destructor
**/ **/
~loopClosureBase2d(){}; ~LoopClosureBase2d(){};
/** \brief update the scene struct with keypoints and descriptors /** \brief update the scene struct with keypoints and descriptors
......
...@@ -46,7 +46,7 @@ typedef falkolib::CGH cgh; ...@@ -46,7 +46,7 @@ typedef falkolib::CGH cgh;
typedef falkolib::CGHExtractor<falkolib::FALKO> cghExtractor; typedef falkolib::CGHExtractor<falkolib::FALKO> cghExtractor;
typedef falkolib::AHTMatcher<falkolib::FALKO> AHTatcher; typedef falkolib::AHTMatcher<falkolib::FALKO> AHTatcher;
struct parameterLoopClosureFalko { struct ParameterLoopClosureFalko {
// Keypoints extractor Default // Keypoints extractor Default
double min_extraction_range_=0.1; double min_extraction_range_=0.1;
double max_extraction_range_=25; double max_extraction_range_=25;
...@@ -69,7 +69,7 @@ struct parameterLoopClosureFalko { ...@@ -69,7 +69,7 @@ struct parameterLoopClosureFalko {
**/ **/
template <typename D, typename Extr, typename M> template <typename D, typename Extr, typename M>
class loopClosureFalko : public loopClosureBase2d, class LoopClosureFalko : public LoopClosureBase2d,
public falkolib::FALKOExtractor { public falkolib::FALKOExtractor {
private: private:
public: public:
...@@ -81,8 +81,8 @@ public: ...@@ -81,8 +81,8 @@ public:
/** \brief Constructor /** \brief Constructor
**/ **/
loopClosureFalko(parameterLoopClosureFalko _param) LoopClosureFalko(ParameterLoopClosureFalko _param)
: loopClosureBase2d(), falkolib::FALKOExtractor(), : LoopClosureBase2d(), falkolib::FALKOExtractor(),
extractor_(_param.circularSectorNumber_, _param.radialRingNumber_), matcher_() { extractor_(_param.circularSectorNumber_, _param.radialRingNumber_), matcher_() {
// FALKO Extractor Parameters // FALKO Extractor Parameters
setMinExtractionRange(_param.min_extraction_range_); setMinExtractionRange(_param.min_extraction_range_);
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
/** \brief Destructor /** \brief Destructor
**/ **/
~loopClosureFalko() {} ~LoopClosureFalko() {}
/** \brief Create and update the scene struct with keypoints and descriptors /** \brief Create and update the scene struct with keypoints and descriptors
**/ **/
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
int matching_number = int matching_number =
matcher_.match(scene_1_falko->keypoints_list_, matcher_.match(scene_1_falko->keypoints_list_,
scene_2_falko->keypoints_list_, asso_nn); scene_2_falko->keypoints_list_, asso_nn);
auto new_match = std::make_shared<matchLoopClosure>(); auto new_match = std::make_shared<MatchLoopClosure>();
new_match->keypoints_number_match = matching_number; new_match->keypoints_number_match = matching_number;
if (matching_number > keypoints_number_th_) { if (matching_number > keypoints_number_th_) {
new_match->match = true; new_match->match = true;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace laserscanutils { namespace laserscanutils {
struct matchLoopClosure { struct MatchLoopClosure {
sceneBasePtr scene_1; sceneBasePtr scene_1;
sceneBasePtr scene_2; sceneBasePtr scene_2;
...@@ -29,7 +29,7 @@ struct matchLoopClosure { ...@@ -29,7 +29,7 @@ struct matchLoopClosure {
double score; double score;
}; };
typedef std::shared_ptr<matchLoopClosure> matchLoopClosurePtr; typedef std::shared_ptr<MatchLoopClosure> matchLoopClosurePtr;
} /* namespace laserscanutils */ } /* namespace laserscanutils */
......
...@@ -17,8 +17,8 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) { ...@@ -17,8 +17,8 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) {
scan2.ranges_raw_.push_back(testRanges2[i]); scan2.ranges_raw_.push_back(testRanges2[i]);
} }
parameterLoopClosureFalko param; ParameterLoopClosureFalko param;
loopClosureFalko<bsc, bscExtractor, NNMatcher> loop_cl_falko(param); LoopClosureFalko<bsc, bscExtractor, NNMatcher> loop_cl_falko(param);
// Test convert2LaserScanFALKO // Test convert2LaserScanFALKO
std::shared_ptr<falkolib::LaserScan> scan_falko = std::shared_ptr<falkolib::LaserScan> scan_falko =
...@@ -49,9 +49,7 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) { ...@@ -49,9 +49,7 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) {
ASSERT_EQ(matchings.size(), 2); ASSERT_EQ(matchings.size(), 2);
auto best_match = matchings.rbegin()->second; auto best_match = matchings.rbegin()->second;
ASSERT_EQ(best_match->match, true); ASSERT_EQ(best_match->match, true);
ASSERT_EQ(best_match->scene_1, new_scene); ASSERT_EQ(best_match->scene_1, new_scene);
ASSERT_EQ(best_match->scene_2, new_scene); ASSERT_EQ(best_match->scene_2, new_scene);
ASSERT_EQ(best_match->score, 1); ASSERT_EQ(best_match->score, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment