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
48fb8128
Commit
48fb8128
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
frameBase::getCapturesOfType of specific type
parent
9e7a92f7
No related branches found
No related tags found
1 merge request
!466
devel->main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/frame/frame_base.h
+26
-14
26 additions, 14 deletions
include/core/frame/frame_base.h
with
26 additions
and
14 deletions
include/core/frame/frame_base.h
+
26
−
14
View file @
48fb8128
...
@@ -139,17 +139,17 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha
...
@@ -139,17 +139,17 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha
bool
isConstrainedBy
(
const
FactorBaseConstPtr
&
_factor
)
const
;
bool
isConstrainedBy
(
const
FactorBaseConstPtr
&
_factor
)
const
;
template
<
class
C
>
template
<
class
C
>
CaptureBaseC
onst
Ptr
getCaptureOfType
()
const
;
std
::
shared_ptr
<
c
onst
C
>
getCaptureOfType
()
const
;
template
<
class
C
>
template
<
class
C
>
CaptureBasePtr
getCaptureOfType
();
std
::
shared_ptr
<
C
>
getCaptureOfType
();
CaptureBaseConstPtr
getCaptureOfType
(
const
std
::
string
&
type
)
const
;
CaptureBaseConstPtr
getCaptureOfType
(
const
std
::
string
&
type
)
const
;
CaptureBasePtr
getCaptureOfType
(
const
std
::
string
&
type
);
CaptureBasePtr
getCaptureOfType
(
const
std
::
string
&
type
);
template
<
class
C
>
template
<
class
C
>
CaptureBaseConstPtrList
getCapturesOfType
()
const
;
std
::
list
<
std
::
shared_ptr
<
const
C
>>
getCapturesOfType
()
const
;
template
<
class
C
>
template
<
class
C
>
CaptureBasePtrList
getCapturesOfType
();
std
::
list
<
std
::
shared_ptr
<
C
>>
getCapturesOfType
();
CaptureBaseConstPtrList
getCapturesOfType
(
const
std
::
string
&
type
)
const
;
CaptureBaseConstPtrList
getCapturesOfType
(
const
std
::
string
&
type
)
const
;
CaptureBasePtrList
getCapturesOfType
(
const
std
::
string
&
type
);
CaptureBasePtrList
getCapturesOfType
(
const
std
::
string
&
type
);
...
@@ -290,40 +290,52 @@ inline void FrameBase::setTrajectory(TrajectoryBasePtr _trj_ptr)
...
@@ -290,40 +290,52 @@ inline void FrameBase::setTrajectory(TrajectoryBasePtr _trj_ptr)
}
}
template
<
class
C
>
template
<
class
C
>
inline
CaptureBaseC
onst
Ptr
FrameBase
::
getCaptureOfType
()
const
inline
std
::
shared_ptr
<
c
onst
C
>
FrameBase
::
getCaptureOfType
()
const
{
{
for
(
auto
capture_ptr
:
getCaptureList
())
for
(
auto
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
{
auto
cap_derived
=
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
);
if
(
cap_derived
)
return
capture_ptr
;
return
capture_ptr
;
}
return
nullptr
;
return
nullptr
;
}
}
template
<
class
C
>
template
<
class
C
>
inline
CaptureBasePtr
FrameBase
::
getCaptureOfType
()
inline
std
::
shared_ptr
<
C
>
FrameBase
::
getCaptureOfType
()
{
{
for
(
auto
capture_ptr
:
getCaptureList
())
for
(
auto
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
{
auto
cap_derived
=
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
);
if
(
cap_derived
)
return
capture_ptr
;
return
capture_ptr
;
}
return
nullptr
;
return
nullptr
;
}
}
template
<
class
C
>
template
<
class
C
>
inline
CaptureBaseConstPtrList
FrameBase
::
getCapturesOfType
()
const
inline
std
::
list
<
std
::
shared_ptr
<
const
C
>>
FrameBase
::
getCapturesOfType
()
const
{
{
CaptureBaseConstPtrList
captures
;
std
::
list
<
std
::
shared_ptr
<
const
C
>>
captures
;
for
(
auto
capture_ptr
:
getCaptureList
())
for
(
auto
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
{
auto
cap_derived
=
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
);
if
(
cap_derived
)
captures
.
push_back
(
capture_ptr
);
captures
.
push_back
(
capture_ptr
);
}
return
captures
;
return
captures
;
}
}
template
<
class
C
>
template
<
class
C
>
inline
CaptureBasePtrList
FrameBase
::
getCapturesOfType
()
inline
std
::
list
<
std
::
shared_ptr
<
C
>>
FrameBase
::
getCapturesOfType
()
{
{
CaptureBasePtrList
captures
;
std
::
list
<
std
::
shared_ptr
<
C
>>
captures
;
for
(
auto
capture_ptr
:
getCaptureList
())
for
(
auto
capture_ptr
:
getCaptureList
())
if
(
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
)
!=
nullptr
)
{
auto
cap_derived
=
std
::
dynamic_pointer_cast
<
C
>
(
capture_ptr
);
if
(
cap_derived
)
captures
.
push_back
(
capture_ptr
);
captures
.
push_back
(
capture_ptr
);
}
return
captures
;
return
captures
;
}
}
...
...
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