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
c19c19a9
Commit
c19c19a9
authored
4 years ago
by
Sergi Pujol
Browse files
Options
Downloads
Patches
Plain Diff
added gtest for findLoopClosure function
parent
93c8821a
No related branches found
No related tags found
1 merge request
!4
Resolve "Implementation of Falko lib"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/loop_closure_falko.cpp
+4
-2
4 additions, 2 deletions
src/loop_closure_falko.cpp
src/loop_closure_falko.h
+25
-6
25 additions, 6 deletions
src/loop_closure_falko.h
test/gtest_loop_closure_base_2d.cpp
+10
-0
10 additions, 0 deletions
test/gtest_loop_closure_base_2d.cpp
with
39 additions
and
8 deletions
src/loop_closure_falko.cpp
+
4
−
2
View file @
c19c19a9
...
...
@@ -30,11 +30,11 @@ namespace laserscanutils{
matcher_
.
setDistanceThreshold
(
0.1
);
}
/*
// DESTRUCTOR
template <typename D,typename Extr, typename M>
loopClosureFalko<D,Extr,M>::~loopClosureFalko(){}
*/
template
<
typename
D
,
typename
Extr
,
typename
M
>
std
::
shared_ptr
<
falkolib
::
LaserScan
>
loopClosureFalko
<
D
,
Extr
,
M
>::
convert2LaserScanFALKO
(
LaserScan
&
scan
,
LaserScanParams
&
scanParams
){
auto
scanFALKO
=
std
::
make_shared
<
falkolib
::
LaserScan
>
(
scanParams
.
angle_min_
,
scanParams
.
angle_max_
,
scan
.
ranges_raw_
.
size
());
...
...
@@ -76,6 +76,8 @@ namespace laserscanutils{
*/
//void findLoopClosure(std::list<sceneFalko>& scenes, const cornerScene newScene){}
//Explicitly compile all the templates
template
class
loopClosureFalko
<
bsc
,
bscExtractor
,
NNMatcher
>;
}
This diff is collapsed.
Click to expand it.
src/loop_closure_falko.h
+
25
−
6
View file @
c19c19a9
...
...
@@ -11,6 +11,8 @@
#include
<iostream>
#include
<fstream>
#include
<memory>
#include
<iterator>
#include
<list>
/**************************
* laser_scan_utils includes *
...
...
@@ -63,11 +65,7 @@ public:
/** \brief Destructor
**/
~
loopClosureFalko
();
/** \brief compare new scans against the trained set in order to find loop closures
**/
//void findLoopClosure(std::list<sceneFalko>& scenes, const cornerScene newScene){}
~
loopClosureFalko
(){}
/** \brief Create and update the scene struct with keypoints and descriptors
**/
...
...
@@ -101,7 +99,28 @@ public:
new_match
->
sceneTuple
=
std
::
make_tuple
(
scene1
,
scene2
);
return
new_match
;
}
/** \brief compare new scans against the trained set in order to find loop closures
**/
std
::
list
<
matchLoopClosurePtr
>
findLoopClosure
(
std
::
list
<
sceneFalkoBSCPtr
>
&
l_scenes
,
const
sceneFalkoBSCPtr
&
new_scene
){
int
number_ref_sc
=
l_scenes
.
size
();
std
::
list
<
matchLoopClosurePtr
>
matchings
;
for
(
int
i
=
0
;
i
<
number_ref_sc
;
i
++
){
auto
l_front
=
l_scenes
.
begin
();
std
::
advance
(
l_front
,
i
);
//std::cout << "list_scenes[i]" << *l_front << std::endl;
//matchScene()
}
return
matchings
;
}
};
}
/* namespace laserscanutils */
...
...
This diff is collapsed.
Click to expand it.
test/gtest_loop_closure_base_2d.cpp
+
10
−
0
View file @
c19c19a9
...
...
@@ -41,6 +41,16 @@ TEST(loop_closure_falko, TestExtractSceneAndMatcher)
ASSERT_EQ
(
keypoints_matched
,
18
);
//TEST findLoopClosure
std
::
list
<
std
::
shared_ptr
<
sceneFalko
<
bsc
>>>
ref_scenes
;
ref_scenes
.
push_back
(
new_scene
);
ref_scenes
.
push_back
(
new_scene
);
auto
matchings
=
LCFalko
.
findLoopClosure
(
ref_scenes
,
new_scene
);
// PRINTF("All good at TestTest::DummyTestExample !\n");
}
...
...
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