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
9941412d
Commit
9941412d
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
track_matrix assuming emplaced features (remove capture pointer) and new add function
parent
cb62672f
No related branches found
No related tags found
1 merge request
!274
Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/processor/track_matrix.h
+3
-2
3 additions, 2 deletions
include/core/processor/track_matrix.h
src/processor/track_matrix.cpp
+12
-9
12 additions, 9 deletions
src/processor/track_matrix.cpp
with
15 additions
and
11 deletions
include/core/processor/track_matrix.h
+
3
−
2
View file @
9941412d
...
...
@@ -78,8 +78,9 @@ class TrackMatrix
TrackMatrix
();
virtual
~
TrackMatrix
();
void
newTrack
(
CaptureBasePtr
_cap
,
FeatureBasePtr
_ftr
);
void
add
(
size_t
_track_id
,
CaptureBasePtr
_cap
,
FeatureBasePtr
_ftr
);
void
newTrack
(
FeatureBasePtr
_ftr
);
void
add
(
const
SizeStd
&
_track_id
,
const
FeatureBasePtr
&
_ftr
);
void
add
(
const
FeatureBasePtr
&
_ftr_existing
,
const
FeatureBasePtr
&
_ftr_new
);
void
remove
(
FeatureBasePtr
_ftr
);
void
remove
(
const
SizeStd
&
_track_id
);
void
remove
(
CaptureBasePtr
_cap
);
...
...
This diff is collapsed.
Click to expand it.
src/processor/track_matrix.cpp
+
12
−
9
View file @
9941412d
...
...
@@ -38,21 +38,24 @@ Snapshot TrackMatrix::snapshot(CaptureBasePtr _capture)
return
Snapshot
();
}
void
TrackMatrix
::
newTrack
(
CaptureBasePtr
_cap
,
FeatureBasePtr
_ftr
)
void
TrackMatrix
::
newTrack
(
FeatureBasePtr
_ftr
)
{
track_id_count_
++
;
add
(
track_id_count_
,
_cap
,
_ftr
);
add
(
track_id_count_
,
_ftr
);
}
void
TrackMatrix
::
add
(
size_t
_track_id
,
CaptureBasePtr
_cap
,
FeatureBasePtr
_ftr
)
void
TrackMatrix
::
add
(
const
SizeStd
&
_track_id
,
const
FeatureBasePtr
&
_ftr
)
{
assert
(
(
_track_id
>
0
)
&&
(
_track_id
<=
track_id_count_
)
&&
"Provided track ID does not exist. Use newTrack() instead."
);
assert
(
tracks_
.
count
(
_track_id
)
!=
0
&&
"Provided track ID does not exist. Use newTrack() instead."
);
assert
(
_ftr
->
getCapture
()
!=
nullptr
&&
"adding a feature not linked to any capture"
);
_ftr
->
setTrackId
(
_track_id
);
if
(
_cap
!=
_ftr
->
getCapture
())
_ftr
->
setCapture
(
_cap
);
tracks_
[
_track_id
].
emplace
(
_cap
->
getTimeStamp
(),
_ftr
);
snapshots_
[
_cap
->
id
()].
emplace
(
_track_id
,
_ftr
);
// will create new snapshot if _cap_id is not present
tracks_
[
_track_id
].
emplace
(
_ftr
->
getCapture
()
->
getTimeStamp
(),
_ftr
);
snapshots_
[
_ftr
->
getCapture
()
->
id
()].
emplace
(
_track_id
,
_ftr
);
// will create new snapshot if _cap_id is not present
}
void
TrackMatrix
::
add
(
const
FeatureBasePtr
&
_ftr_existing
,
const
FeatureBasePtr
&
_ftr_new
)
{
add
(
_ftr_existing
->
trackId
(),
_ftr_new
);
}
void
TrackMatrix
::
remove
(
const
SizeStd
&
_track_id
)
...
...
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