Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Stack Of Tasks
pinocchio
Commits
0aae68f0
Commit
0aae68f0
authored
8 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[C++] Fix removeCollisionPairsFromSrdf (update to API changes)
parent
c1d09714
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parsers/srdf.hpp
+23
-24
23 additions, 24 deletions
src/parsers/srdf.hpp
with
23 additions
and
24 deletions
src/parsers/srdf.hpp
+
23
−
24
View file @
0aae68f0
...
...
@@ -39,13 +39,13 @@ namespace se3
/// It throws if the SRDF file is incorrect.
///
/// \param[in] model Model of the kinematic tree.
/// \param[in]
model_geom
Model of the geometries.
/// \param[in]
geomModel
Model of the geometries.
/// \param[out] data_geom Data containing the active collision pairs.
/// \param[in] filename The complete path to the SRDF file.
/// \param[in] verbose Verbosity mode (print removed collision pairs and undefined link inside the model).
///
inline
void
removeCollisionPairsFromSrdf
(
const
Model
&
model
,
GeometryModel
&
model_geom
,
GeometryModel
&
geomModel
,
const
std
::
string
&
filename
,
const
bool
verbose
)
throw
(
std
::
invalid_argument
)
{
...
...
@@ -99,30 +99,29 @@ namespace se3
continue
;
}
typedef
GeometryModel
::
GeomIndexList
GeomIndexList
;
typedef
std
::
map
<
JointIndex
,
GeomIndexList
>
GeomIndexListMap
;
GeomIndexListMap
::
const_iterator
_innerObject1
=
model_geom
.
innerObjects
.
find
(
joint_id1
);
if
(
_innerObject1
==
model_geom
.
innerObjects
.
end
())
continue
;
GeomIndexListMap
::
const_iterator
_innerObject2
=
model_geom
.
innerObjects
.
find
(
joint_id2
);
if
(
_innerObject2
==
model_geom
.
innerObjects
.
end
())
continue
;
const
GeomIndexList
&
innerObject1
=
_innerObject1
->
second
;
const
GeomIndexList
&
innerObject2
=
_innerObject2
->
second
;
for
(
GeomIndexList
::
const_iterator
it1
=
innerObject1
.
begin
();
it1
!=
innerObject1
.
end
();
++
it1
)
{
if
(
model_geom
.
geometryObjects
[
*
it1
].
parentFrame
!=
frame_id1
)
continue
;
for
(
GeomIndexList
::
const_iterator
it2
=
innerObject2
.
begin
();
it2
!=
innerObject2
.
end
();
++
it2
)
{
if
(
model_geom
.
geometryObjects
[
*
it2
].
parentFrame
!=
frame_id2
)
continue
;
model_geom
.
removeCollisionPair
(
CollisionPair
(
*
it1
,
*
it2
));
if
(
verbose
)
std
::
cout
<<
"Remove collision pair ("
<<
joint_id1
<<
","
<<
joint_id2
<<
")"
<<
std
::
endl
;
typedef
std
::
vector
<
CollisionPair
>
CollisionPairs_t
;
bool
didRemove
=
false
;
for
(
CollisionPairs_t
::
iterator
_colPair
=
geomModel
.
collisionPairs
.
begin
();
_colPair
!=
geomModel
.
collisionPairs
.
end
();
)
{
const
CollisionPair
&
colPair
(
*
_colPair
);
bool
remove
=
(
(
geomModel
.
geometryObjects
[
colPair
.
first
].
parentFrame
==
frame_id1
)
&&
(
geomModel
.
geometryObjects
[
colPair
.
second
].
parentFrame
==
frame_id2
)
)
||
(
(
geomModel
.
geometryObjects
[
colPair
.
second
].
parentFrame
==
frame_id1
)
&&
(
geomModel
.
geometryObjects
[
colPair
.
first
].
parentFrame
==
frame_id2
)
);
if
(
remove
)
{
_colPair
=
geomModel
.
collisionPairs
.
erase
(
_colPair
);
didRemove
=
true
;
}
else
{
++
_colPair
;
}
}
if
(
didRemove
&&
verbose
)
std
::
cout
<<
"Remove collision pair ("
<<
link1
<<
","
<<
link2
<<
")"
<<
std
::
endl
;
}
}
// BOOST_FOREACH
...
...
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