Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
laser_scan_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
laser_scan_utils
Commits
37ea081d
Commit
37ea081d
authored
11 months ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
Ptr typedef
parent
cb09614a
No related branches found
No related tags found
No related merge requests found
Pipeline
#18764
passed
11 months ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/laser_scan_utils/loop_closure_base.h
+36
-34
36 additions, 34 deletions
include/laser_scan_utils/loop_closure_base.h
with
36 additions
and
34 deletions
include/laser_scan_utils/loop_closure_base.h
+
36
−
34
View file @
37ea081d
...
@@ -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_ */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment