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
c874d6a4
Commit
c874d6a4
authored
4 years ago
by
Sergi Pujol
Browse files
Options
Downloads
Patches
Plain Diff
refactor
parent
12e27911
No related branches found
No related tags found
1 merge request
!4
Resolve "Implementation of Falko lib"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/loop_closure_falko.h
+12
-28
12 additions, 28 deletions
src/loop_closure_falko.h
with
12 additions
and
28 deletions
src/loop_closure_falko.h
+
12
−
28
View file @
c874d6a4
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include
<iostream>
#include
<iostream>
#include
<iterator>
#include
<iterator>
#include
<list>
#include
<list>
#include
<math.h>
#include
<memory>
#include
<memory>
/**************************
/**************************
...
@@ -67,10 +68,10 @@ struct ParameterLoopClosureFalko {
...
@@ -67,10 +68,10 @@ struct ParameterLoopClosureFalko {
int
match_type_
=
1
;
// match_type=1-> uses keypoints and descriptors for
int
match_type_
=
1
;
// match_type=1-> uses keypoints and descriptors for
// matching. match_type=2-> uses only keypoints for
// matching. match_type=2-> uses only keypoints for
// matching
// matching
double
matcher_ddesc_th_
=
0.2
;
double
matcher_ddesc_th_
=
0.2
;
// aht matcher
// aht matcher
double
xRes_
=
0.1
;
double
xRes_
=
0.1
;
double
yRes_
=
0.1
;
double
yRes_
=
0.1
;
double
thetaRes_
=
0.04
;
double
thetaRes_
=
0.04
;
double
xAbsMax_
=
5
;
double
xAbsMax_
=
5
;
...
@@ -152,9 +153,16 @@ public:
...
@@ -152,9 +153,16 @@ public:
**/
**/
matchLoopClosurePtr
matchScene
(
sceneBasePtr
_scene_1
,
matchLoopClosurePtr
matchScene
(
sceneBasePtr
_scene_1
,
sceneBasePtr
_scene_2
)
override
{
sceneBasePtr
_scene_2
)
override
{
// int n_rotations = 8;
// for (i = 0; i < n_rotations; i++) {
// double rotation = (2 * M_PI / n_rotations) * i;
std
::
vector
<
std
::
pair
<
int
,
int
>>
asso_nn
;
std
::
vector
<
std
::
pair
<
int
,
int
>>
asso_nn
;
auto
scene_1_falko
=
std
::
static_pointer_cast
<
SceneFalko
<
D
>>
(
_scene_1
);
auto
scene_1_falko
=
std
::
static_pointer_cast
<
SceneFalko
<
D
>>
(
_scene_1
);
auto
scene_2_falko
=
std
::
static_pointer_cast
<
SceneFalko
<
D
>>
(
_scene_2
);
auto
scene_2_falko
=
std
::
static_pointer_cast
<
SceneFalko
<
D
>>
(
_scene_2
);
// //Rotate all descriptors of the list
// for (j=0; j<)
// scene_2_falko->descriptors_list_[j]
int
matching_number
=
0
;
int
matching_number
=
0
;
if
(
match_type_
==
1
)
{
if
(
match_type_
==
1
)
{
...
@@ -165,13 +173,7 @@ public:
...
@@ -165,13 +173,7 @@ public:
scene_1_falko
->
keypoints_list_
,
scene_1_falko
->
descriptors_list_
,
scene_1_falko
->
keypoints_list_
,
scene_1_falko
->
descriptors_list_
,
scene_2_falko
->
keypoints_list_
,
scene_2_falko
->
descriptors_list_
,
scene_2_falko
->
keypoints_list_
,
scene_2_falko
->
descriptors_list_
,
asso_nn
);
asso_nn
);
}
/*else if (match_type_ = 3) {
matching_number =
matcher_desc_.match(scene_1_falko->descriptors_list_,
scene_2_falko->descriptors_list_, asso_nn);
}
}
*/
auto
new_match
=
std
::
make_shared
<
MatchLoopClosure
>
();
auto
new_match
=
std
::
make_shared
<
MatchLoopClosure
>
();
new_match
->
keypoints_number_match
=
matching_number
;
new_match
->
keypoints_number_match
=
matching_number
;
if
(
matching_number
>
keypoints_number_th_
)
{
if
(
matching_number
>
keypoints_number_th_
)
{
...
@@ -187,28 +189,10 @@ public:
...
@@ -187,28 +189,10 @@ public:
new_match
->
score
=
(
double
)
matching_number
/
new_match
->
score
=
(
double
)
matching_number
/
(
double
)
std
::
min
(
scene_1_falko
->
keypoints_list_
.
size
(),
(
double
)
std
::
min
(
scene_1_falko
->
keypoints_list_
.
size
(),
scene_2_falko
->
keypoints_list_
.
size
());
scene_2_falko
->
keypoints_list_
.
size
());
//}
return
new_match
;
return
new_match
;
}
}
/** \brief compare new scans against the trained set in order to find loop
*closures
**/
/*
std::map<double, matchLoopClosurePtr>
findLoopClosure(sceneBaseListPtr _l_scenes,
const sceneBasePtr _new_scene) override {
auto _l_scenes_falko =
std::static_pointer_cast<SceneFalkoList<D>>(_l_scenes);
auto new_scene_falko =
std::static_pointer_cast<SceneFalko<D>>(_new_scene); std::map<double,
matchLoopClosurePtr> matchings; for (auto scene : _l_scenes_falko->scenes_)
{ auto ref_scene = std::static_pointer_cast<SceneFalko<D>>(scene); auto
match = matchScene(ref_scene, new_scene_falko);
matchings.emplace(match->score, match);
}
return matchings;
}
*/
int
keypoints_number_th_
;
int
keypoints_number_th_
;
int
match_type_
;
int
match_type_
;
};
};
...
...
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