Skip to content
Snippets Groups Projects

Resolve "Implementation of Falko lib"

Merged Sergi Pujol Badell requested to merge 26-implementation-of-falko-lib into master
2 files
+ 37
75
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 18
18
@@ -105,16 +105,16 @@ public:
@@ -105,16 +105,16 @@ public:
/** \brief Create and update the scene struct with keypoints and descriptors
/** \brief Create and update the scene struct with keypoints and descriptors
**/
**/
sceneFalkoBSCPtr extractScene(LaserScan &scan, LaserScanParams &scanParams) {
sceneFalkoBSCPtr extractScene(LaserScan &_scan, LaserScanParams &_scan_params) {
auto newScene = std::make_shared<sceneFalko<D>>();
auto new_scene = std::make_shared<sceneFalko<D>>();
auto scanFALKO =
auto scan_falko =
loopClosureFalko<D, Extr, M>::convert2LaserScanFALKO(scan, scanParams);
convert2LaserScanFALKO(_scan, _scan_params);
// Extract keypoints
// Extract keypoints
extract((*scanFALKO), (newScene->keypointsList));
extract(*scan_falko, (new_scene->keypointsList));
// Compute descriptors
// Compute descriptors
extractor_.compute(*scanFALKO, newScene->keypointsList,
extractor_.compute(*scan_falko, new_scene->keypointsList,
newScene->descriptorsList);
new_scene->descriptorsList);
return newScene;
return new_scene;
}
}
/** \brief Convert scans from laserscanutils::LaserScan to
/** \brief Convert scans from laserscanutils::LaserScan to
@@ -132,11 +132,11 @@ public:
@@ -132,11 +132,11 @@ public:
/** \brief Create and update a matchLoopClosure struct with the info that is
/** \brief Create and update a matchLoopClosure struct with the info that is
*produced when matching two given scenes
*produced when matching two given scenes
**/
**/
matchLoopClosurePtr matchScene(sceneFalkoBSCPtr scene1,
matchLoopClosurePtr matchScene(sceneFalkoBSCPtr _scene1,
sceneFalkoBSCPtr scene2) {
sceneFalkoBSCPtr _scene2) {
std::vector<std::pair<int, int>> assoNN;
std::vector<std::pair<int, int>> asso_nn;
int matching_number =
int matching_number =
matcher_.match(scene1->keypointsList, scene2->keypointsList, assoNN);
matcher_.match(_scene1->keypointsList, _scene2->keypointsList, asso_nn);
auto new_match = std::make_shared<matchLoopClosure<D>>();
auto new_match = std::make_shared<matchLoopClosure<D>>();
new_match->keypointsNumberMatch = matching_number;
new_match->keypointsNumberMatch = matching_number;
if (matching_number > keypoints_number_th) {
if (matching_number > keypoints_number_th) {
@@ -144,7 +144,7 @@ public:
@@ -144,7 +144,7 @@ public:
} else {
} else {
new_match->match = false;
new_match->match = false;
}
}
new_match->sceneTuple = std::make_tuple(scene1, scene2);
new_match->sceneTuple = std::make_tuple(_scene1, _scene2);
return new_match;
return new_match;
}
}
@@ -152,14 +152,14 @@ public:
@@ -152,14 +152,14 @@ public:
*closures
*closures
**/
**/
std::list<matchLoopClosurePtr>
std::list<matchLoopClosurePtr>
findLoopClosure(std::list<sceneFalkoBSCPtr> &l_scenes,
findLoopClosure(std::list<sceneFalkoBSCPtr> &_l_scenes,
const sceneFalkoBSCPtr &new_scene) {
const sceneFalkoBSCPtr &_new_scene) {
int number_ref_sc = l_scenes.size();
int number_ref_sc = _l_scenes.size();
std::list<matchLoopClosurePtr> matchings;
std::list<matchLoopClosurePtr> matchings;
for (int i = 0; i < number_ref_sc; i++) {
for (int i = 0; i < number_ref_sc; i++) {
auto l_front = l_scenes.begin();
auto l_front = _l_scenes.begin();
std::advance(l_front, i);
std::advance(l_front, i);
auto new_match = matchScene(*l_front, new_scene);
auto new_match = matchScene(*l_front, _new_scene);
matchings.push_back(new_match);
matchings.push_back(new_match);
}
}
return matchings;
return matchings;
Loading