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
3f2caf0e
Commit
3f2caf0e
authored
4 years ago
by
Sergi Pujol
Browse files
Options
Downloads
Patches
Plain Diff
added struct loopClosurParams
parent
b4f6adfa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Resolve "Implementation of Falko lib"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/loop_closure_falko.h
+40
-18
40 additions, 18 deletions
src/loop_closure_falko.h
test/gtest_loop_closure_falko.cpp
+6
-2
6 additions, 2 deletions
test/gtest_loop_closure_falko.cpp
with
46 additions
and
20 deletions
src/loop_closure_falko.h
+
40
−
18
View file @
3f2caf0e
...
@@ -46,6 +46,25 @@ typedef falkolib::CGH cgh;
...
@@ -46,6 +46,25 @@ typedef falkolib::CGH cgh;
typedef
falkolib
::
CGHExtractor
<
falkolib
::
FALKO
>
cghExtractor
;
typedef
falkolib
::
CGHExtractor
<
falkolib
::
FALKO
>
cghExtractor
;
typedef
falkolib
::
AHTMatcher
<
falkolib
::
FALKO
>
AHTatcher
;
typedef
falkolib
::
AHTMatcher
<
falkolib
::
FALKO
>
AHTatcher
;
struct
parameterLoopClosureFalko
{
// Keypoints extractor
double
_min_extraction_range
=
0.1
;
double
_max_extraction_range
=
25
;
bool
_enable_subbeam
=
true
;
double
_nms_radius
=
0.1
;
double
_neigh_b
=
0.01
;
double
_b_ratio
=
4
;
int
_grid_sectors
=
16
;
//Descriptors parameters
int
_circularSectorNumber
=
16
;
int
_radialRingNumber
=
8
;
//matcher threshold
double
matcher_distance_th
=
0.1
;
int
keypoints_number_th
=
5
;
};
/** \brief A base class for loop closure using falko library
/** \brief A base class for loop closure using falko library
**/
**/
...
@@ -63,20 +82,21 @@ public:
...
@@ -63,20 +82,21 @@ public:
/** \brief Constructor
/** \brief Constructor
**/
**/
loopClosureFalko
(
int
_circularSectorNumber
=
16
,
int
_radialRingNumber
=
8
)
loopClosureFalko
(
parameterLoopClosureFalko
param
)
:
loopClosureBase2d
(),
falkolib
::
FALKOExtractor
(),
:
loopClosureBase2d
(),
falkolib
::
FALKOExtractor
(),
extractor_
(
_circularSectorNumber
,
_radialRingNumber
),
matcher_
()
{
extractor_
(
param
.
_circularSectorNumber
,
param
.
_radialRingNumber
),
matcher_
()
{
// FALKO Extractor Parameters
// FALKO Extractor Parameters
setMinExtractionRange
(
0.1
);
setMinExtractionRange
(
param
.
_min_extraction_range
);
setMaxExtractionRange
(
25
);
setMaxExtractionRange
(
param
.
_max_extraction_range
);
enableSubbeam
(
true
);
enableSubbeam
(
param
.
_enable_subbeam
);
setNMSRadius
(
0.1
);
setNMSRadius
(
param
.
_nms_radius
);
setNeighB
(
0.01
);
setNeighB
(
param
.
_neigh_b
);
setBRatio
(
4
);
setBRatio
(
param
.
_b_ratio
);
setGridSectors
(
16
);
setGridSectors
(
param
.
_grid_sectors
);
// Matcher Extractor Parameters
// Matcher Extractor Parameters
matcher_
.
setDistanceThreshold
(
0.1
);
matcher_
.
setDistanceThreshold
(
param
.
matcher_distance_th
);
keypoints_number_th
=
param
.
keypoints_number_th
;
};
};
/** \brief Destructor
/** \brief Destructor
...
@@ -100,13 +120,13 @@ public:
...
@@ -100,13 +120,13 @@ public:
/** \brief Convert scans from laserscanutils::LaserScan to
/** \brief Convert scans from laserscanutils::LaserScan to
*falkolib::LaserScan object
*falkolib::LaserScan object
**/
**/
laserScanPtr
convert2LaserScanFALKO
(
LaserScan
&
scan
,
LaserScanParams
&
scan
P
arams
)
{
laserScanPtr
convert2LaserScanFALKO
(
LaserScan
&
_
scan
,
LaserScanParams
&
_
scan
_p
arams
)
{
auto
scan
FALKO
=
std
::
make_shared
<
falkolib
::
LaserScan
>
(
auto
scan
_falko
=
std
::
make_shared
<
falkolib
::
LaserScan
>
(
scan
P
arams
.
angle_min_
,
scan
P
arams
.
angle_max_
,
scan
.
ranges_raw_
.
size
());
_
scan
_p
arams
.
angle_min_
,
_
scan
_p
arams
.
angle_max_
,
_
scan
.
ranges_raw_
.
size
());
std
::
vector
<
double
>
double
R
anges
(
scan
.
ranges_raw_
.
begin
(),
std
::
vector
<
double
>
double
_r
anges
(
_
scan
.
ranges_raw_
.
begin
(),
scan
.
ranges_raw_
.
end
());
_
scan
.
ranges_raw_
.
end
());
((
*
scan
FALKO
).
fromRanges
)
(
double
R
anges
);
scan
_falko
->
fromRanges
(
double
_r
anges
);
return
scan
FALKO
;
return
scan
_falko
;
};
};
/** \brief Create and update a matchLoopClosure struct with the info that is
/** \brief Create and update a matchLoopClosure struct with the info that is
...
@@ -119,7 +139,6 @@ public:
...
@@ -119,7 +139,6 @@ public:
matcher_
.
match
(
scene1
->
keypointsList
,
scene2
->
keypointsList
,
assoNN
);
matcher_
.
match
(
scene1
->
keypointsList
,
scene2
->
keypointsList
,
assoNN
);
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
;
int
keypoints_number_th
=
5
;
if
(
matching_number
>
keypoints_number_th
)
{
if
(
matching_number
>
keypoints_number_th
)
{
new_match
->
match
=
true
;
new_match
->
match
=
true
;
}
else
{
}
else
{
...
@@ -145,6 +164,9 @@ public:
...
@@ -145,6 +164,9 @@ public:
}
}
return
matchings
;
return
matchings
;
}
}
int
keypoints_number_th
;
};
};
}
/* namespace laserscanutils */
}
/* namespace laserscanutils */
...
...
This diff is collapsed.
Click to expand it.
test/gtest_loop_closure_falko.cpp
+
6
−
2
View file @
3f2caf0e
...
@@ -17,7 +17,9 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) {
...
@@ -17,7 +17,9 @@ TEST(loop_closure_falko, TestLoopClosureFalkoAllFunctions) {
scan
.
ranges_raw_
.
push_back
(
testRanges1
[
i
]);
scan
.
ranges_raw_
.
push_back
(
testRanges1
[
i
]);
}
}
loopClosureFalko
<
bsc
,
bscExtractor
,
NNMatcher
>
LCFalko
;
parameterLoopClosureFalko
param
;
loopClosureFalko
<
bsc
,
bscExtractor
,
NNMatcher
>
LCFalko
(
param
);
auto
new_scene
=
LCFalko
.
extractScene
(
scan
,
laserParams
);
auto
new_scene
=
LCFalko
.
extractScene
(
scan
,
laserParams
);
...
@@ -73,7 +75,9 @@ TEST(loop_closure_falko2, convert2laserScanFalko) {
...
@@ -73,7 +75,9 @@ TEST(loop_closure_falko2, convert2laserScanFalko) {
scan
.
ranges_raw_
.
push_back
(
testRanges1
[
i
]);
scan
.
ranges_raw_
.
push_back
(
testRanges1
[
i
]);
}
}
loopClosureFalko
<
bsc
,
bscExtractor
,
NNMatcher
>
LCFalko
;
parameterLoopClosureFalko
param
;
loopClosureFalko
<
bsc
,
bscExtractor
,
NNMatcher
>
LCFalko
(
param
);
std
::
shared_ptr
<
falkolib
::
LaserScan
>
scanFALKO
=
std
::
shared_ptr
<
falkolib
::
LaserScan
>
scanFALKO
=
LCFalko
.
convert2LaserScanFALKO
(
scan
,
laserParams
);
LCFalko
.
convert2LaserScanFALKO
(
scan
,
laserParams
);
...
...
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