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
Merge requests
!413
Resolve "New ProcessorLoopClosure"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "New ProcessorLoopClosure"
398-new-processorloopclosure
into
devel
Overview
1
Commits
11
Pipelines
11
Changes
9
Merged
Joan Vallvé Navarro
requested to merge
398-new-processorloopclosure
into
devel
4 years ago
Overview
1
Commits
11
Pipelines
11
Changes
9
Expand
Closes
#398 (closed)
Edited
4 years ago
by
Joan Vallvé Navarro
0
0
Merge request reports
Compare
devel
version 9
7ef34d03
4 years ago
version 8
57082085
4 years ago
version 7
113de502
4 years ago
version 6
f0993e97
4 years ago
version 5
14a2ae91
4 years ago
version 4
ffa7ab6f
4 years ago
version 3
c753b9c4
4 years ago
version 2
b0fe5fd1
4 years ago
version 1
b267af5d
4 years ago
devel (base)
and
latest version
latest version
5b76a6c4
11 commits,
3 years ago
version 9
7ef34d03
10 commits,
4 years ago
version 8
57082085
8 commits,
4 years ago
version 7
113de502
7 commits,
4 years ago
version 6
f0993e97
6 commits,
4 years ago
version 5
14a2ae91
5 commits,
4 years ago
version 4
ffa7ab6f
4 commits,
4 years ago
version 3
c753b9c4
3 commits,
4 years ago
version 2
b0fe5fd1
2 commits,
4 years ago
version 1
b267af5d
1 commit,
4 years ago
9 files
+
689
−
411
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
9
Search (e.g. *.vue) (Ctrl+P)
include/core/processor/processor_loop_closure.h
0 → 100644
+
110
−
0
Options
#ifndef _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H
#define _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H
// Wolf related headers
#include
"core/processor/processor_base.h"
namespace
wolf
{
WOLF_STRUCT_PTR_TYPEDEFS
(
ParamsProcessorLoopClosure
);
struct
ParamsProcessorLoopClosure
:
public
ParamsProcessorBase
{
int
max_loops
=-
1
;
ParamsProcessorLoopClosure
()
=
default
;
ParamsProcessorLoopClosure
(
std
::
string
_unique_name
,
const
ParamsServer
&
_server
)
:
ParamsProcessorBase
(
_unique_name
,
_server
)
{
max_loops
=
_server
.
getParam
<
int
>
(
prefix
+
_unique_name
+
"/max_loops"
);
}
std
::
string
print
()
const
override
{
return
"
\n
"
+
ParamsProcessorBase
::
print
()
+
"max_loops: "
+
std
::
to_string
(
max_loops
)
+
"
\n
"
;
}
};
WOLF_STRUCT_PTR_TYPEDEFS
(
MatchLoopClosure
);
/** \brief Match between a capture and a capture
*
* Match between a capture and a capture (capture-capture correspondence)
*
*/
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)
};
/** \brief General loop closure processor
*
* This is an abstract class.
* + You must define the following classes :
* - voteFindLoopClosures(CaptureBasePtr)
* - emplaceFeatures(CaptureBasePtr)
* - findLoopClosures(CaptureBasePtr)
* - validateLoop(CaptureBasePtr, CaptureBasePtr)
* - emplaceFactors(CaptureBasePtr, CaptureBasePtr)
* + You can override the following classes :
* - process(CaptureBasePtr)
*/
class
ProcessorLoopClosure
:
public
ProcessorBase
{
protected:
ParamsProcessorLoopClosurePtr
params_loop_closure_
;
public:
ProcessorLoopClosure
(
const
std
::
string
&
_type
,
int
_dim
,
ParamsProcessorLoopClosurePtr
_params_loop_closure
);
~
ProcessorLoopClosure
()
override
=
default
;
void
configure
(
SensorBasePtr
_sensor
)
override
{
};
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 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 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 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
;
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
voteForKeyFrame
()
const
override
{
return
false
;};
};
}
// namespace wolf
#endif
/* _WOLF_PROCESSOR_LOOP_CLOSURE_BASE_H */
Loading