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
65e79c90
Commit
65e79c90
authored
4 years ago
by
Sergi Pujol
Browse files
Options
Downloads
Patches
Plain Diff
Added CornerFalko2d::findLoopClosure function
parent
22ef78f6
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/corner_falko_2d.cpp
+35
-7
35 additions, 7 deletions
src/corner_falko_2d.cpp
src/corner_falko_2d.h
+5
-11
5 additions, 11 deletions
src/corner_falko_2d.h
src/examples/corner_falko_demo.cpp
+4
-1
4 additions, 1 deletion
src/examples/corner_falko_demo.cpp
with
44 additions
and
19 deletions
src/corner_falko_2d.cpp
+
35
−
7
View file @
65e79c90
...
...
@@ -26,18 +26,46 @@ CornerFalko2d::~CornerFalko2d()
}
void
CornerFalko2d
::
train
(
falkolib
::
LaserScan
scan
){
void
CornerFalko2d
::
storeCorners
(
falkolib
::
LaserScan
scan
,
int
scanInterval
){
// Extract keypoints
lastKeypointSet
.
clear
();
extract
(
scan
,
lastKeypointSet
);
scanNumber
=
scanNumber
+
1
;
if
(
scanNumber
%
scanInterval
==
0
){
// Extract keypoints
lastKeypointSet
.
clear
();
extract
(
scan
,
lastKeypointSet
);
//Compute descriptors
lastDescriptorSet
.
clear
();
compute
(
scan
,
lastKeypointSet
,
lastDescriptorSet
);
keypointSets
.
push_back
(
lastKeypointSet
);
descriptorSets
.
push_back
(
lastDescriptorSet
);
}
}
void
CornerFalko2d
::
findLoopClosure
(
falkolib
::
LaserScan
scan
){
//Compute descriptors
std
::
vector
<
falkolib
::
FALKO
>
keypointSet2
;
extract
(
scan
,
keypointSet2
);
//Compute descriptors
lastDescriptorSet
.
clear
();
compute
(
scan
,
lastKeypointSet
,
lastDescriptorSet
);
std
::
vector
<
falkolib
::
BSC
>
descriptorSet2
;
compute
(
scan
,
keypointSet2
,
descriptorSet2
);
//Matching
for
(
int
i
=
0
;
i
<
keypointSets
.
size
();
i
++
){
std
::
vector
<
std
::
pair
<
int
,
int
>
>
assoNN
;
int
matchingNumber
=
match
(
keypointSets
[
i
],
keypointSet2
,
assoNN
);
}
}
}
// laserscanutils namespace
}
// laserscanutils namespace
This diff is collapsed.
Click to expand it.
src/corner_falko_2d.h
+
5
−
11
View file @
65e79c90
...
...
@@ -41,7 +41,7 @@ namespace laserscanutils
*
*/
class
CornerFalko2d
:
public
falkolib
::
FALKOExtractor
,
falkolib
::
BSCExtractor
<
falkolib
::
FALKO
>
class
CornerFalko2d
:
public
falkolib
::
FALKOExtractor
,
falkolib
::
BSCExtractor
<
falkolib
::
FALKO
>
,
falkolib
::
NNMatcher
<
falkolib
::
FALKO
>
{
public:
/**
...
...
@@ -62,7 +62,7 @@ public:
/** \brief Gets a set of landmarks/scenes to use as trained set.
**/
void
train
(
falkolib
::
LaserScan
scan
);
void
storeCorners
(
falkolib
::
LaserScan
scan
,
int
scanInterval
);
/** \brief Extract landmark/scene (list of corners) from a given 2D scan
**/
...
...
@@ -70,22 +70,16 @@ public:
/** \brief compare new scans against the training set in order to find loop closures
**/
void
findLoopClosure
();
void
findLoopClosure
(
falkolib
::
LaserScan
scan
);
std
::
vector
<
std
::
vector
<
falkolib
::
FALKO
>>
keypointSets
;
std
::
vector
<
falkolib
::
FALKO
>
lastKeypointSet
;
std
::
vector
<
std
::
vector
<
falkolib
::
BSC
>>
descriptorSets
;
std
::
vector
<
falkolib
::
BSC
>
lastDescriptorSet
;
//int _circularSectorNumber;
//int _radialRingNumber;
// Keypoints extractor
//falkolib::FALKOExtractor fe;
// BSC descriptor extractor
//falkolib::BSCExtractor<falkolib::FALKO> bsc(_circularSectorNumber,_radialRingNumber);
int
scanNumber
=
0
;
};
}
/* namespace
wolf
*/
}
/* namespace
laserscanutils
*/
#endif
/* LANDMARK_POLYLINE_2d_H_ */
This diff is collapsed.
Click to expand it.
src/examples/corner_falko_demo.cpp
+
4
−
1
View file @
65e79c90
...
...
@@ -21,6 +21,7 @@ int main(int argc, char** argv)
{
int
scanSize
=
1440
;
int
scanInterval
=
1
;
falkolib
::
LaserScan
scan1
(
0
,
2.0
*
M_PI
,
scanSize
);
...
...
@@ -28,8 +29,10 @@ int main(int argc, char** argv)
CornerFalko2d
CornerMatching
;
CornerMatching
.
extract
(
scan1
,
CornerMatching
.
lastKeypointSet
);
CornerMatching
.
storeCorners
(
scan1
,
scanInterval
);
std
::
cout
<<
"num keypoints1 extracted: "
<<
CornerMatching
.
lastKeypointSet
.
size
()
<<
std
::
endl
;
CornerMatching
.
findLoopClosure
(
scan1
);
}
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