Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-manipulation
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
Humanoid Path Planner
hpp-manipulation
Commits
9fc2fd10
Commit
9fc2fd10
authored
9 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Graph helper: properly order nodes in NodeSelector
parent
457d857a
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/graph/helper.cc
+15
-14
15 additions, 14 deletions
src/graph/helper.cc
with
15 additions
and
14 deletions
src/graph/helper.cc
+
15
−
14
View file @
9fc2fd10
...
@@ -645,12 +645,14 @@ namespace hpp {
...
@@ -645,12 +645,14 @@ namespace hpp {
}
}
};
};
const
NodeAndManifold_t
&
makeNode
(
Result
&
r
,
const
GraspV_t
&
g
)
const
NodeAndManifold_t
&
makeNode
(
Result
&
r
,
const
GraspV_t
&
g
,
const
int
priority
)
{
{
NodeAndManifold_t
&
nam
=
r
(
g
);
NodeAndManifold_t
&
nam
=
r
(
g
);
if
(
!
nam
.
get
<
0
>
())
{
if
(
!
nam
.
get
<
0
>
())
{
hppDout
(
info
,
"Creating node "
<<
r
.
name
(
g
));
hppDout
(
info
,
"Creating node "
<<
r
.
name
(
g
));
nam
.
get
<
0
>
()
=
r
.
graph
->
nodeSelector
()
->
createNode
(
r
.
name
(
g
));
nam
.
get
<
0
>
()
=
r
.
graph
->
nodeSelector
()
->
createNode
(
r
.
name
(
g
),
false
,
priority
);
// Loop over the grippers and create grasping constraints if required
// Loop over the grippers and create grasping constraints if required
FoliatedManifold
unused
;
FoliatedManifold
unused
;
std
::
set
<
index_t
>
idxsOH
;
std
::
set
<
index_t
>
idxsOH
;
...
@@ -691,10 +693,10 @@ namespace hpp {
...
@@ -691,10 +693,10 @@ namespace hpp {
/// \li for all i != iG, gTo[iG] == gFrom[iG]
/// \li for all i != iG, gTo[iG] == gFrom[iG]
void
makeEdge
(
Result
&
r
,
void
makeEdge
(
Result
&
r
,
const
GraspV_t
&
gFrom
,
const
GraspV_t
&
gTo
,
const
GraspV_t
&
gFrom
,
const
GraspV_t
&
gTo
,
const
index_t
iG
)
const
index_t
iG
,
const
int
priority
)
{
{
const
NodeAndManifold_t
&
from
=
makeNode
(
r
,
gFrom
),
const
NodeAndManifold_t
&
from
=
makeNode
(
r
,
gFrom
,
priority
),
to
=
makeNode
(
r
,
gTo
);
to
=
makeNode
(
r
,
gTo
,
priority
+
1
);
FoliatedManifold
grasp
,
pregrasp
,
place
,
preplace
,
FoliatedManifold
grasp
,
pregrasp
,
place
,
preplace
,
submanifold
;
submanifold
;
r
.
graspManifold
(
iG
,
gTo
[
iG
],
grasp
,
pregrasp
);
r
.
graspManifold
(
iG
,
gTo
[
iG
],
grasp
,
pregrasp
);
...
@@ -780,7 +782,7 @@ namespace hpp {
...
@@ -780,7 +782,7 @@ namespace hpp {
/// idx are the available grippers
/// idx are the available grippers
void
recurseGrippers
(
Result
&
r
,
void
recurseGrippers
(
Result
&
r
,
const
IndexV_t
&
idx_g
,
const
IndexV_t
&
idx_oh
,
const
IndexV_t
&
idx_g
,
const
IndexV_t
&
idx_oh
,
const
GraspV_t
&
grasps
)
const
GraspV_t
&
grasps
,
const
int
depth
)
{
{
if
(
idx_g
.
empty
()
||
idx_oh
.
empty
())
return
;
if
(
idx_g
.
empty
()
||
idx_oh
.
empty
())
return
;
IndexV_t
nIdx_g
(
idx_g
.
size
()
-
1
);
IndexV_t
nIdx_g
(
idx_g
.
size
()
-
1
);
...
@@ -793,18 +795,17 @@ namespace hpp {
...
@@ -793,18 +795,17 @@ namespace hpp {
);
);
for
(
IndexV_t
::
const_iterator
itx_oh
=
idx_oh
.
begin
();
for
(
IndexV_t
::
const_iterator
itx_oh
=
idx_oh
.
begin
();
itx_oh
!=
idx_oh
.
end
();
++
itx_oh
)
{
itx_oh
!=
idx_oh
.
end
();
++
itx_oh
)
{
// Copy all element except itx_oh
std
::
copy
(
boost
::
next
(
itx_oh
),
idx_oh
.
end
(),
std
::
copy
(
idx_oh
.
begin
(),
itx_oh
,
nIdx_oh
.
begin
())
);
// Create the edge for the selected grasp
// Create the edge for the selected grasp
GraspV_t
nGrasps
=
grasps
;
GraspV_t
nGrasps
=
grasps
;
nGrasps
[
*
itx_g
]
=
*
itx_oh
;
nGrasps
[
*
itx_g
]
=
*
itx_oh
;
makeEdge
(
r
,
grasps
,
nGrasps
,
*
itx_g
);
makeEdge
(
r
,
grasps
,
nGrasps
,
*
itx_g
,
depth
);
// Copy all element except itx_oh
std
::
copy
(
boost
::
next
(
itx_oh
),
idx_oh
.
end
(),
std
::
copy
(
idx_oh
.
begin
(),
itx_oh
,
nIdx_oh
.
begin
())
);
// Do all the possible combination below this new grasp
// Do all the possible combination below this new grasp
recurseGrippers
(
r
,
nIdx_g
,
nIdx_oh
,
nGrasps
);
recurseGrippers
(
r
,
nIdx_g
,
nIdx_oh
,
nGrasps
,
depth
+
2
);
}
}
}
}
}
}
...
@@ -827,7 +828,7 @@ namespace hpp {
...
@@ -827,7 +828,7 @@ namespace hpp {
GraspV_t
iG
(
r
.
nG
,
r
.
nOH
);
GraspV_t
iG
(
r
.
nG
,
r
.
nOH
);
recurseGrippers
(
r
,
availG
,
availOH
,
iG
);
recurseGrippers
(
r
,
availG
,
availOH
,
iG
,
0
);
}
}
GraphPtr_t
graphBuilder
(
GraphPtr_t
graphBuilder
(
...
...
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