Skip to content
Snippets Groups Projects
Commit 37ea081d authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

Ptr typedef

parent cb09614a
No related branches found
No related tags found
No related merge requests found
Pipeline #18764 passed
...@@ -40,50 +40,52 @@ ...@@ -40,50 +40,52 @@
#include "match_loop_closure_scene.h" #include "match_loop_closure_scene.h"
#include "scene_base.h" #include "scene_base.h"
namespace laserscanutils { namespace laserscanutils
/** \brief A 2base class for loop closure using falko library
*/
class LoopClosureBase2d
{ {
private: class LoopClosureBase2d;
public: typedef std::shared_ptr<LoopClosureBase2d> LoopClosureBase2dPtr;
/** \brief Constructor
**/ /** \brief A 2base class for loop closure using falko library
LoopClosureBase2d(){}; */
class LoopClosureBase2d
{
public:
/** \brief Constructor
**/
LoopClosureBase2d(){};
/** \brief Destructor /** \brief Destructor
**/ **/
virtual ~LoopClosureBase2d(){}; virtual ~LoopClosureBase2d(){};
/** \brief update the scene struct with keypoints and descriptors /** \brief update the scene struct with keypoints and descriptors
**/ **/
virtual sceneBasePtr extractScene(const LaserScan &scan, const LaserScanParams &scanParams) = 0; virtual sceneBasePtr extractScene(const LaserScan &scan, const LaserScanParams &scanParams) = 0;
/** \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
**/ **/
virtual MatchLoopClosureScenePtr matchScene(sceneBasePtr _scene1, sceneBasePtr _scene2) = 0; virtual MatchLoopClosureScenePtr matchScene(sceneBasePtr _scene1, sceneBasePtr _scene2) = 0;
/** \brief It matches a target scene against a list of references scenes in order to find loop /** \brief It matches a target scene against a list of references scenes in order to find loop
* closures * closures
**/ **/
virtual std::map<double, MatchLoopClosureScenePtr> findLoopClosure(std::list<std::shared_ptr<SceneBase>> _l_scenes, virtual std::map<double, MatchLoopClosureScenePtr> findLoopClosure(std::list<std::shared_ptr<SceneBase>> _l_scenes,
const sceneBasePtr _new_scene) const sceneBasePtr _new_scene)
{ {
std::map<double, MatchLoopClosureScenePtr> matchings; std::map<double, MatchLoopClosureScenePtr> matchings;
for (auto ref_scene : _l_scenes) for (auto ref_scene : _l_scenes)
{ {
auto match = matchScene(ref_scene, _new_scene); auto match = matchScene(ref_scene, _new_scene);
while (matchings.find(match->score)!=matchings.end()) while (matchings.find(match->score) != matchings.end())
match->score+=0.001; match->score += 0.001;
matchings.emplace(match->score, match); matchings.emplace(match->score, match);
} }
return matchings; return matchings;
} }
}; };
} /* namespace laserscanutils */ } /* namespace laserscanutils */
#endif /* LOOP_CLOSURE_BASE_2D_H_ */ #endif /* LOOP_CLOSURE_BASE_2D_H_ */
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