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

added gtest for findLoopClosure function

parent 93c8821a
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -30,11 +30,11 @@ namespace laserscanutils{
matcher_.setDistanceThreshold(0.1);
}
/*
// DESTRUCTOR
template <typename D,typename Extr, typename M>
loopClosureFalko<D,Extr,M>::~loopClosureFalko(){}
*/
template <typename D,typename Extr, typename M>
std::shared_ptr<falkolib::LaserScan> loopClosureFalko<D,Extr, M>::convert2LaserScanFALKO(LaserScan &scan,LaserScanParams &scanParams){
auto scanFALKO=std::make_shared<falkolib::LaserScan>(scanParams.angle_min_, scanParams.angle_max_, scan.ranges_raw_.size());
......@@ -76,6 +76,8 @@ namespace laserscanutils{
*/
//void findLoopClosure(std::list<sceneFalko>& scenes, const cornerScene newScene){}
//Explicitly compile all the templates
template class loopClosureFalko <bsc, bscExtractor, NNMatcher>;
}
......@@ -11,6 +11,8 @@
#include <iostream>
#include <fstream>
#include <memory>
#include <iterator>
#include <list>
/**************************
* laser_scan_utils includes *
......@@ -63,11 +65,7 @@ public:
/** \brief Destructor
**/
~loopClosureFalko();
/** \brief compare new scans against the trained set in order to find loop closures
**/
//void findLoopClosure(std::list<sceneFalko>& scenes, const cornerScene newScene){}
~loopClosureFalko(){}
/** \brief Create and update the scene struct with keypoints and descriptors
**/
......@@ -101,7 +99,28 @@ public:
new_match -> sceneTuple = std::make_tuple(scene1,scene2);
return new_match;
}
/** \brief compare new scans against the trained set in order to find loop closures
**/
std::list<matchLoopClosurePtr> findLoopClosure(std::list<sceneFalkoBSCPtr> &l_scenes, const sceneFalkoBSCPtr &new_scene){
int number_ref_sc = l_scenes.size();
std::list<matchLoopClosurePtr> matchings;
for (int i=0; i<number_ref_sc; i++ ){
auto l_front = l_scenes.begin();
std::advance(l_front, i);
//std::cout << "list_scenes[i]" << *l_front << std::endl;
//matchScene()
}
return matchings;
}
};
} /* namespace laserscanutils */
......
......@@ -41,6 +41,16 @@ TEST(loop_closure_falko, TestExtractSceneAndMatcher)
ASSERT_EQ(keypoints_matched, 18);
//TEST findLoopClosure
std::list<std::shared_ptr<sceneFalko<bsc>>> ref_scenes;
ref_scenes.push_back(new_scene);
ref_scenes.push_back(new_scene);
auto matchings = LCFalko.findLoopClosure(ref_scenes,new_scene);
// PRINTF("All good at TestTest::DummyTestExample !\n");
}
......
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