Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
bfa5be8c
Commit
bfa5be8c
authored
3 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
small changes in MatchLoopClosure struct
parent
8f05890c
No related branches found
No related tags found
No related merge requests found
Pipeline
#7115
passed
3 years ago
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/processor/processor_loop_closure.h
+39
-39
39 additions, 39 deletions
include/core/processor/processor_loop_closure.h
test/dummy/processor_loop_closure_dummy.h
+8
-8
8 additions, 8 deletions
test/dummy/processor_loop_closure_dummy.h
with
47 additions
and
47 deletions
include/core/processor/processor_loop_closure.h
+
39
−
39
View file @
bfa5be8c
...
...
@@ -22,10 +22,10 @@ struct ParamsProcessorLoopClosure : public ParamsProcessorBase
std
::
string
print
()
const
override
{
return
"
\n
"
+
ParamsProcessorBase
::
print
()
+
"max_loops: "
+
std
::
to_string
(
max_loops
)
+
"
\n
"
;
+
"max_loops: "
+
std
::
to_string
(
max_loops
)
+
"
\n
"
;
}
};
WOLF_STRUCT_PTR_TYPEDEFS
(
MatchLoopClosure
);
/** \brief Match between a capture and a capture
...
...
@@ -35,9 +35,9 @@ WOLF_STRUCT_PTR_TYPEDEFS(MatchLoopClosure);
*/
struct
MatchLoopClosure
{
CaptureBasePtr
capture_reference
_ptr_
;
///< Capture reference
CaptureBasePtr
capture_target
_ptr_
;
///< Capture target
double
normalized_score
_
;
///< normalized similarity score (0 is bad, 1 is good)
CaptureBasePtr
capture_reference
;
///< Capture reference
CaptureBasePtr
capture_target
;
///< Capture target
double
normalized_score
;
///< normalized similarity score (0 is bad, 1 is good)
};
/** \brief General loop closure processor
...
...
@@ -54,55 +54,55 @@ struct MatchLoopClosure
*/
class
ProcessorLoopClosure
:
public
ProcessorBase
{
protected:
protected:
ParamsProcessorLoopClosurePtr
params_loop_closure_
;
ParamsProcessorLoopClosurePtr
params_loop_closure_
;
public:
public:
ProcessorLoopClosure
(
const
std
::
string
&
_type
,
int
_dim
,
ParamsProcessorLoopClosurePtr
_params_loop_closure
);
ProcessorLoopClosure
(
const
std
::
string
&
_type
,
int
_dim
,
ParamsProcessorLoopClosurePtr
_params_loop_closure
);
~
ProcessorLoopClosure
()
override
=
default
;
void
configure
(
SensorBasePtr
_sensor
)
override
{
};
~
ProcessorLoopClosure
()
override
=
default
;
void
configure
(
SensorBasePtr
_sensor
)
override
{
};
protected
:
protected
:
/** \brief Process a capture (linked to a frame)
* If voteFindLoopClosures() returns true, findLoopClosures() is called.
* emplaceFactors() is called for pairs of current capture and each capture returned by findLoopClosures()
*/
virtual
void
process
(
CaptureBasePtr
);
/** \brief Process a capture (linked to a frame)
* If voteFindLoopClosures() returns true, findLoopClosures() is called.
* emplaceFactors() is called for pairs of current capture and each capture returned by findLoopClosures()
*/
virtual
void
process
(
CaptureBasePtr
);
/** \brief Returns if findLoopClosures() has to be called for the given capture
*/
virtual
bool
voteFindLoopClosures
(
CaptureBasePtr
cap
)
=
0
;
/** \brief Returns if findLoopClosures() has to be called for the given capture
*/
virtual
bool
voteFindLoopClosures
(
CaptureBasePtr
cap
)
=
0
;
/** \brief detects and emplaces all features of the given capture
*/
virtual
void
emplaceFeatures
(
CaptureBasePtr
cap
)
=
0
;
/** \brief detects and emplaces all features of the given capture
*/
virtual
void
emplaceFeatures
(
CaptureBasePtr
cap
)
=
0
;
/** \brief Find captures that correspond to loop closures with the given capture
*/
virtual
std
::
map
<
double
,
MatchLoopClosurePtr
>
findLoopClosures
(
CaptureBasePtr
_capture
)
=
0
;
/** \brief Find captures that correspond to loop closures with the given capture
*/
virtual
std
::
map
<
double
,
MatchLoopClosurePtr
>
findLoopClosures
(
CaptureBasePtr
_capture
)
=
0
;
/** \brief validates a loop closure
*/
virtual
bool
validateLoopClosure
(
MatchLoopClosurePtr
)
=
0
;
/** \brief validates a loop closure
*/
virtual
bool
validateLoopClosure
(
MatchLoopClosurePtr
)
=
0
;
/** \brief emplaces the factor(s) corresponding to a Loop Closure between two captures
*/
virtual
void
emplaceFactors
(
MatchLoopClosurePtr
)
=
0
;
/** \brief emplaces the factor(s) corresponding to a Loop Closure between two captures
*/
virtual
void
emplaceFactors
(
MatchLoopClosurePtr
)
=
0
;
void
processCapture
(
CaptureBasePtr
)
override
;
void
processKeyFrame
(
FrameBasePtr
,
const
double
&
)
override
;
void
processCapture
(
CaptureBasePtr
)
override
;
void
processKeyFrame
(
FrameBasePtr
,
const
double
&
)
override
;
bool
triggerInCapture
(
CaptureBasePtr
_cap
)
const
override
{
return
true
;};
bool
triggerInKeyFrame
(
FrameBasePtr
_frm
,
const
double
&
_time_tol
)
const
override
{
return
true
;};
bool
triggerInCapture
(
CaptureBasePtr
_cap
)
const
override
{
return
true
;};
bool
triggerInKeyFrame
(
FrameBasePtr
_frm
,
const
double
&
_time_tol
)
const
override
{
return
true
;};
bool
storeKeyFrame
(
FrameBasePtr
_frm
)
override
{
return
false
;};
bool
storeCapture
(
CaptureBasePtr
_cap
)
override
{
return
false
;};
bool
storeKeyFrame
(
FrameBasePtr
_frm
)
override
{
return
false
;};
bool
storeCapture
(
CaptureBasePtr
_cap
)
override
{
return
false
;};
bool
voteForKeyFrame
()
const
override
{
return
false
;};
bool
voteForKeyFrame
()
const
override
{
return
false
;};
};
}
// namespace wolf
...
...
This diff is collapsed.
Click to expand it.
test/dummy/processor_loop_closure_dummy.h
+
8
−
8
View file @
bfa5be8c
...
...
@@ -44,14 +44,14 @@ class ProcessorLoopClosureDummy : public ProcessorLoopClosure
(
feat
->
getMeasurement
()
-
_capture
->
getFeatureList
().
front
()
->
getMeasurement
()).
norm
()
<
1e-3
)
{
MatchLoopClosurePtr
match
=
std
::
make_shared
<
MatchLoopClosure
>
();
match
->
capture_reference
_ptr_
=
cap
;
match
->
capture_target
_ptr_
=
_capture
;
match
->
normalized_score
_
=
1
;
match
->
capture_reference
=
cap
;
match
->
capture_target
=
_capture
;
match
->
normalized_score
=
1
;
while
(
match_lc_map
.
count
(
match
->
normalized_score
_
))
match
->
normalized_score
_
-=
1e-9
;
while
(
match_lc_map
.
count
(
match
->
normalized_score
))
match
->
normalized_score
-=
1e-9
;
match_lc_map
.
emplace
(
match
->
normalized_score
_
,
match
);
match_lc_map
.
emplace
(
match
->
normalized_score
,
match
);
}
old_frame
=
old_frame
->
getPreviousFrame
();
...
...
@@ -63,7 +63,7 @@ class ProcessorLoopClosureDummy : public ProcessorLoopClosure
void
emplaceFactors
(
MatchLoopClosurePtr
match
)
override
{
FeatureBasePtr
feat_2
;
for
(
auto
feat
:
match
->
capture_target
_ptr_
->
getFeatureList
())
for
(
auto
feat
:
match
->
capture_target
->
getFeatureList
())
if
(
feat
->
getType
()
==
"FeatureLoopClosureDummy"
)
{
feat_2
=
feat
;
...
...
@@ -71,7 +71,7 @@ class ProcessorLoopClosureDummy : public ProcessorLoopClosure
}
FactorBase
::
emplace
<
FactorRelativePose2d
>
(
feat_2
,
feat_2
,
match
->
capture_reference
_ptr_
->
getFrame
(),
match
->
capture_reference
->
getFrame
(),
shared_from_this
(),
false
,
TOP_LOOP
);
...
...
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