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

findLoopClosure passed to loop_closure_base.h

parent 87c05d15
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
......@@ -51,8 +51,15 @@ public:
*closures
**/
virtual std::map<double,matchLoopClosurePtr>
findLoopClosure(sceneBaseListPtr _l_scenes,
const sceneBasePtr _new_scene)=0;
findLoopClosure(std::list<std::shared_ptr<SceneBase>> _l_scenes,const sceneBasePtr _new_scene){
std::map<double, matchLoopClosurePtr> matchings;
for (auto ref_scene : _l_scenes) {
auto match = matchScene(ref_scene, _new_scene);
matchings.emplace(match->score, match);
}
return matchings;
}
};
} /* namespace laserscanutils */
......
......@@ -189,6 +189,7 @@ public:
/** \brief compare new scans against the trained set in order to find loop
*closures
**/
/*
std::map<double, matchLoopClosurePtr>
findLoopClosure(sceneBaseListPtr _l_scenes,
const sceneBasePtr _new_scene) override {
......@@ -203,9 +204,11 @@ public:
}
return matchings;
}
*/
int keypoints_number_th_;
};
} /* namespace laserscanutils */
#endif /* LOOP_CLOSURE_FALKO_H_ */
......@@ -13,10 +13,6 @@
#include <memory>
#include <tuple>
/**************************
* laser_scan_utils includes *
**************************/
#include "scene_falko.h"
namespace laserscanutils {
......
......@@ -18,6 +18,7 @@ struct SceneBase {
typedef std::shared_ptr<SceneBase> sceneBasePtr;
struct SceneBaseList {
std::list<std::shared_ptr<SceneBase>> scenes_;
};
typedef std::shared_ptr<SceneBaseList> sceneBaseListPtr;
......
......@@ -42,9 +42,13 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) {
ASSERT_EQ(new_match->keypoints_number_match, 18);
// TesT findLoopClosure
auto ref_scenes = std::make_shared<SceneFalkoList<bsc>>();
ref_scenes->scenes_.emplace_back(new_scene);
ref_scenes->scenes_.emplace_back(new_scene2);
//auto ref_scenes = std::make_shared<SceneFalkoList<bsc>>();
//ref_scenes->scenes_.emplace_back(new_scene);
//ref_scenes->scenes_.emplace_back(new_scene2);
std::list<std::shared_ptr<SceneBase>> ref_scenes;
ref_scenes.emplace_back(new_scene);
ref_scenes.emplace_back(new_scene2);
auto matchings = loop_cl_falko.findLoopClosure(ref_scenes, new_scene);
......
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