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
8f05890c
Commit
8f05890c
authored
3 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
new methods getCapture(s)OfType
parent
050f2a38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#6930
passed
3 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/frame/frame_base.h
+25
-0
25 additions, 0 deletions
include/core/frame/frame_base.h
src/frame/frame_base.cpp
+17
-0
17 additions, 0 deletions
src/frame/frame_base.cpp
with
42 additions
and
0 deletions
include/core/frame/frame_base.h
+
25
−
0
View file @
8f05890c
...
@@ -102,6 +102,12 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha
...
@@ -102,6 +102,12 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha
FrameBasePtr
getNextFrame
()
const
;
FrameBasePtr
getNextFrame
()
const
;
const
CaptureBasePtrList
&
getCaptureList
()
const
;
const
CaptureBasePtrList
&
getCaptureList
()
const
;
template
<
class
C
>
CaptureBasePtr
getCaptureOfType
()
const
;
CaptureBasePtr
getCaptureOfType
(
const
std
::
string
&
type
)
const
;
template
<
class
C
>
CaptureBasePtrList
getCapturesOfType
()
const
;
CaptureBasePtrList
getCapturesOfType
(
const
std
::
string
&
type
)
const
;
CaptureBasePtr
getCaptureOf
(
const
SensorBaseConstPtr
_sensor_ptr
)
const
;
CaptureBasePtr
getCaptureOf
(
const
SensorBaseConstPtr
_sensor_ptr
)
const
;
CaptureBasePtr
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
const
;
CaptureBasePtr
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
const
;
CaptureBasePtrList
getCapturesOf
(
const
SensorBasePtr
_sensor_ptr
)
const
;
CaptureBasePtrList
getCapturesOf
(
const
SensorBasePtr
_sensor_ptr
)
const
;
...
@@ -208,6 +214,25 @@ inline void FrameBase::setTrajectory(TrajectoryBasePtr _trj_ptr)
...
@@ -208,6 +214,25 @@ inline void FrameBase::setTrajectory(TrajectoryBasePtr _trj_ptr)
trajectory_ptr_
=
_trj_ptr
;
trajectory_ptr_
=
_trj_ptr
;
}
}
template
<
class
C
>
inline
CaptureBasePtr
FrameBase
::
getCaptureOfType
()
const
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
return
capture_ptr
;
return
nullptr
;
}
template
<
class
C
>
inline
CaptureBasePtrList
FrameBase
::
getCapturesOfType
()
const
{
CaptureBasePtrList
captures
;
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
captures
.
push_back
(
capture_ptr
);
return
captures
;
}
}
// namespace wolf
}
// namespace wolf
#endif
#endif
This diff is collapsed.
Click to expand it.
src/frame/frame_base.cpp
+
17
−
0
View file @
8f05890c
...
@@ -175,6 +175,23 @@ void FrameBase::removeCapture(CaptureBasePtr _capt_ptr)
...
@@ -175,6 +175,23 @@ void FrameBase::removeCapture(CaptureBasePtr _capt_ptr)
capture_list_
.
remove
(
_capt_ptr
);
capture_list_
.
remove
(
_capt_ptr
);
}
}
CaptureBasePtr
FrameBase
::
getCaptureOfType
(
const
std
::
string
&
type
)
const
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getType
()
==
type
)
return
capture_ptr
;
return
nullptr
;
}
CaptureBasePtrList
FrameBase
::
getCapturesOfType
(
const
std
::
string
&
type
)
const
{
CaptureBasePtrList
captures
;
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
if
(
capture_ptr
->
getType
()
==
type
)
captures
.
push_back
(
capture_ptr
);
return
captures
;
}
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
const
CaptureBasePtr
FrameBase
::
getCaptureOf
(
const
SensorBasePtr
_sensor_ptr
,
const
std
::
string
&
type
)
const
{
{
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
for
(
CaptureBasePtr
capture_ptr
:
getCaptureList
())
...
...
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