Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jason Chemin
hpp-rbprm-corba
Commits
3af852e4
Commit
3af852e4
authored
Nov 21, 2016
by
Steve Tonneau
Browse files
bug fix for standard generation
parent
e666fab0
Changes
1
Hide whitespace changes
Inline
Side-by-side
script/tools/tro_capture_point/gen_hrp2_statically_balanced_positions_2d.py
View file @
3af852e4
...
...
@@ -329,7 +329,7 @@ def _genbalance(limbs):
all_qs
=
[]
all_states
=
[]
def
gen
(
limbs
,
num_samples
=
1000
,
coplanar
=
True
,
num_candidates_per_config
=
1
,
num_contact_candidates
=
10
,
q_entries
=
None
,
projectToObstacles
=
False
):
def
gen
(
limbs
,
num_samples
=
1000
,
coplanar
=
True
,
num_candidates_per_config
=
0
,
num_contact_candidates
=
10
,
q_entries
=
None
,
projectToObstacles
=
False
):
q_0
=
fullBody
.
getCurrentConfig
();
#~ fullBody.getSampleConfig()
qs
=
[];
qs_gepetto
=
[];
states
=
[]
...
...
@@ -354,7 +354,7 @@ def gen(limbs, num_samples = 1000, coplanar = True, num_candidates_per_config =
res
[
"q"
]
=
q
[:]
for
_
in
range
(
num_candidates_per_config
):
gen_contact_candidates
(
limbs
,
q_gep
,
res
,
data
[
"contact_points"
],
num_contact_candidates
,
projectToObstacles
)
if
(
res
.
has_key
(
"candidates"
)):
#contact candidates found
if
(
num_candidates_per_config
==
0
or
res
.
has_key
(
"candidates"
)):
#contact candidates found
states
.
append
(
res
)
qs
.
append
(
q
)
qs_gepetto
.
append
(
q_gep
)
...
...
@@ -390,10 +390,10 @@ limbs = [[lLegId,rLegId],[lLegId,rLegId, rarmId], [lLegId,rLegId, larmId], [lLeg
#~ limbs = [[lLegId,rLegId, rarmId]]
#~ limbs = [[larmId, rarmId]]
#~
gen(limbs[0], 10)
#~
for ls in limbs:
#~
gen(ls, 10, False)
#~
gen(limbs[0], 10)
gen
(
limbs
[
0
],
10
)
for
ls
in
limbs
:
gen
(
ls
,
10
,
False
)
gen
(
limbs
[
0
],
10
)
i
=
0
a
=
None
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment