Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
04e281f9
Commit
04e281f9
authored
4 years ago
by
Raphael Grimm
Browse files
Options
Downloads
Patches
Plain Diff
Add version of RobotNodeSet::createRobotNodeSet that merges several sets
parent
94400790
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/RobotNodeSet.cpp
+25
-0
25 additions, 0 deletions
VirtualRobot/RobotNodeSet.cpp
VirtualRobot/RobotNodeSet.h
+2
-0
2 additions, 0 deletions
VirtualRobot/RobotNodeSet.h
with
27 additions
and
0 deletions
VirtualRobot/RobotNodeSet.cpp
+
25
−
0
View file @
04e281f9
...
...
@@ -81,6 +81,31 @@ namespace VirtualRobot
}
}
}
RobotNodeSetPtr
RobotNodeSet
::
createRobotNodeSet
(
RobotPtr
robot
,
const
std
::
string
&
name
,
const
std
::
vector
<
RobotNodeSetPtr
>&
robotNodes
,
const
RobotNodePtr
kinematicRoot
,
const
RobotNodePtr
tcp
,
bool
registerToRobot
)
{
std
::
set
<
RobotNodePtr
>
nodeSet
;
std
::
vector
<
RobotNodePtr
>
nodes
;
for
(
const
auto
&
rns
:
robotNodes
)
{
THROW_VR_EXCEPTION_IF
(
!
rns
,
"RNS is null"
);
THROW_VR_EXCEPTION_IF
(
rns
->
getRobot
()
!=
robot
,
"RNS for an other robot"
);
for
(
const
auto
&
rn
:
*
rns
)
{
if
(
!
nodeSet
.
count
(
rn
))
{
nodeSet
.
emplace
(
rn
);
nodes
.
emplace_back
(
rn
);
}
}
}
return
createRobotNodeSet
(
robot
,
name
,
nodes
,
kinematicRoot
,
tcp
,
registerToRobot
);
}
RobotNodeSetPtr
RobotNodeSet
::
createRobotNodeSet
(
RobotPtr
robot
,
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/RobotNodeSet.h
+
2
−
0
View file @
04e281f9
...
...
@@ -54,6 +54,8 @@ namespace VirtualRobot
Use this method to create and fully initialize an instance of RobotNodeSet.
*/
static
RobotNodeSetPtr
createRobotNodeSet
(
RobotPtr
robot
,
const
std
::
string
&
name
,
const
std
::
vector
<
RobotNodePtr
>&
robotNodes
,
const
RobotNodePtr
kinematicRoot
=
RobotNodePtr
(),
const
RobotNodePtr
tcp
=
RobotNodePtr
(),
bool
registerToRobot
=
false
);
/// Merges the node sets (takes care of only adding each node once)
static
RobotNodeSetPtr
createRobotNodeSet
(
RobotPtr
robot
,
const
std
::
string
&
name
,
const
std
::
vector
<
RobotNodeSetPtr
>&
robotNodes
,
const
RobotNodePtr
kinematicRoot
=
RobotNodePtr
(),
const
RobotNodePtr
tcp
=
RobotNodePtr
(),
bool
registerToRobot
=
false
);
/*!
Registers a copy of this node set with the given robot
...
...
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