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

added template to cornerScene

parent a3c7a7a3
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.
...@@ -11,13 +11,29 @@ ...@@ -11,13 +11,29 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
/**************************
* Falko includes *
**************************/
#include <falkolib/Feature/FALKO.h>
#include <falkolib/Feature/CGH.h>
#include <falkolib/Feature/BSC.h>
#include <falkolib/Feature/FALKOExtractor.h>
#include <falkolib/Feature/BSCExtractor.h>
#include <falkolib/Feature/CGHExtractor.h>
#include <falkolib/Matching/NNMatcher.h>
#include <falkolib/Matching/AHTMatcher.h>
namespace laserscanutils namespace laserscanutils
{ {
template <typename D>
struct cornerScene{ struct cornerScene{
std::vector<double> keypointsList; std::vector<falkolib::FALKO> keypointsList;
std::vector<double> descriptorsList; std::vector<D> descriptorsList;
}; };
} /* namespace laserscanutils */ } /* namespace laserscanutils */
#endif /* CORNER_SCENE_H_ */ #endif /* CORNER_SCENE_H_ */
\ No newline at end of file
...@@ -51,11 +51,12 @@ public: ...@@ -51,11 +51,12 @@ public:
/** \brief compare new scans against the trained set in order to find loop closures /** \brief compare new scans against the trained set in order to find loop closures
**/ **/
virtual void findLoopClosure(std::list<cornerScene>& scenes, const cornerScene newScene){} //virtual void findLoopClosure(std::list<cornerScene>& scenes, const cornerScene newScene){}
virtual void findLoopClosure(){}
/** \brief update the scene struct with keypoints and descriptors /** \brief update the scene struct with keypoints and descriptors
**/ **/
virtual std::shared_ptr<cornerScene> extractScene(LaserScan &scan,LaserScanParams &scanParams){} virtual void extractScene(LaserScan &scan,LaserScanParams &scanParams){}
/** \brief Convert scans from laserscanutils::LaserScan to falkolib::LaserScan object /** \brief Convert scans from laserscanutils::LaserScan to falkolib::LaserScan object
**/ **/
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
namespace laserscanutils{ namespace laserscanutils{
//CONSTRUCTOR //CONSTRUCTOR
template <typename E, typename M> template <typename D,typename E, typename M>
loopClosureFalko<E, M>::loopClosureFalko(){ loopClosureFalko<D,E, M>::loopClosureFalko(){
// FALKO Extractor Parameters // FALKO Extractor Parameters
setMinExtractionRange(0.1); setMinExtractionRange(0.1);
setMaxExtractionRange(25); setMaxExtractionRange(25);
...@@ -23,18 +23,21 @@ namespace laserscanutils{ ...@@ -23,18 +23,21 @@ namespace laserscanutils{
// Matcher Extractor Parameters // Matcher Extractor Parameters
matcher.setDistanceThreshold(0.1); matcher.setDistanceThreshold(0.1);
} }
// DESTRUCTOR // DESTRUCTOR
template <typename E, typename M> template <typename D,typename E, typename M>
loopClosureFalko<E,M>::~loopClosureFalko(){} loopClosureFalko<D,E,M>::~loopClosureFalko(){}
template <typename D,typename E, typename M>
std::shared_ptr<cornerScene<D>> loopClosureFalko<D,E, M>::extractScene(LaserScan &scan,LaserScanParams &scanParams){
auto scanFALKO =loopClosureFalko<D,E,M>::convert2LaserScanFALKO(scan, scanParams);
template <typename E, typename M>
std::shared_ptr<cornerScene> loopClosureFalko<E, M>::extractScene(LaserScan &scan,LaserScanParams &scanParams){
auto scanFALKO =loopClosureFalko<E,M>::convert2LaserScanFALKO(scan, scanParams); auto NewScene=std::make_shared<cornerScene<D>>();
auto NewScene=std::make_shared<cornerScene>();
return NewScene; return NewScene;
} }
......
...@@ -34,12 +34,15 @@ ...@@ -34,12 +34,15 @@
namespace laserscanutils namespace laserscanutils
{ {
typedef falkolib::BSC bsc;
typedef falkolib::BSCExtractor<falkolib::FALKO> bscExtractor; typedef falkolib::BSCExtractor<falkolib::FALKO> bscExtractor;
typedef falkolib::NNMatcher<falkolib::FALKO> NNMatcher; typedef falkolib::NNMatcher<falkolib::FALKO> NNMatcher;
/** \brief A base class for loop closure using falko library /** \brief A base class for loop closure using falko library
**/ **/
template <typename E, typename M> template <typename D, typename E, typename M>
class loopClosureFalko : public falkolib::FALKOExtractor{ class loopClosureFalko : public falkolib::FALKOExtractor{
private: private:
...@@ -54,11 +57,11 @@ public: ...@@ -54,11 +57,11 @@ public:
/** \brief compare new scans against the trained set in order to find loop closures /** \brief compare new scans against the trained set in order to find loop closures
**/ **/
void findLoopClosure(std::list<cornerScene>& scenes, const cornerScene newScene){} //void findLoopClosure(std::list<cornerScene>& scenes, const cornerScene newScene){}
/** \brief update the scene struct with keypoints and descriptors /** \brief update the scene struct with keypoints and descriptors
**/ **/
std::shared_ptr<cornerScene> extractScene(LaserScan &scan,LaserScanParams &scanParams); std::shared_ptr<cornerScene<D>> extractScene(LaserScan &scan,LaserScanParams &scanParams);
E extractor; E extractor;
M matcher; M matcher;
......
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