Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
multicontact-locomotion-planning
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
loco-3d
multicontact-locomotion-planning
Commits
1a32f5df
Commit
1a32f5df
authored
5 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
[wholebody] correctly check the motion for collision and joint limits at each phase
parent
cad47a67
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/hpp_wholebody_motion/wholebody/tsid_invdyn.py
+16
-9
16 additions, 9 deletions
scripts/hpp_wholebody_motion/wholebody/tsid_invdyn.py
with
16 additions
and
9 deletions
scripts/hpp_wholebody_motion/wholebody/tsid_invdyn.py
+
16
−
9
View file @
1a32f5df
...
...
@@ -243,6 +243,10 @@ def generateWholeBodyMotion(cs,viewer=None,fullBody=None):
invdyn
.
computeProblemData
(
t
,
q
,
v
)
data
=
invdyn
.
data
()
if
cfg
.
EFF_CHECK_COLLISION
:
# initialise object needed to check the motion
from
hpp_wholebody_motion.utils
import
check_path
validator
=
check_path
.
PathChecker
(
viewer
,
fullBody
,
cs
,
len
(
q
),
False
)
if
cfg
.
WB_VERBOSE
:
print
"
initialize tasks :
"
comTask
=
tsid
.
TaskComEquality
(
"
task-com
"
,
robot
)
...
...
@@ -408,7 +412,7 @@ def generateWholeBodyMotion(cs,viewer=None,fullBody=None):
# end effector (if they exists)
for
eeName
,
traj
in
dic_effectors_trajs
.
iteritems
():
if
traj
:
swingPhase
=
True
swingPhase
=
True
# there is an effector motion in this phase
sampleEff
=
effectorTraj
.
computeNext
()
sampleEff
.
pos
(
SE3toVec
(
traj
(
t
)[
0
]))
sampleEff
.
vel
(
MotiontoVec
(
traj
(
t
)[
1
]))
...
...
@@ -456,16 +460,19 @@ def generateWholeBodyMotion(cs,viewer=None,fullBody=None):
return
q_t
+
q_t_phase
,
v_t
+
v_t_phase
,
a_t
+
a_t_phase
# end while t \in phase_t (loop for the current contact phase)
if
swingPhase
and
cfg
.
EFF_CHECK_COLLISION
:
phaseValid
=
iter_for_phase
>=
1
#TODO : check collision here instead for this debug code
phaseValid
=
True
# DEBUG FIXME
phaseValid
,
t_invalid
=
validator
.
check_motion
(
q_t_phase
)
if
not
phaseValid
:
if
cfg
.
WB_VERBOSE
:
print
"
Phase
"
+
str
(
pid
)
+
"
not valid, try new end effector trajectory.
"
for
eeName
,
oldTraj
in
dic_effectors_trajs
.
iteritems
():
if
oldTraj
:
# update the traj in the map
ref_traj
=
generateEEReferenceTrajCollisionFree
(
fullBody
,
robot
,
invdyn
.
data
(),
t_begin
,
phase_prev
,
phase
,
phase_next
,
q_t_phase
,
oldTraj
,
eeName
,
pid
,
viewer
)
dic_effectors_trajs
.
update
({
eeName
:
ref_traj
})
else
:
# no effector motions, phase always valid
print
"
Phase
"
+
str
(
pid
)
+
"
not valid at t =
"
+
t_invalid
if
cfg
.
WB_ABORT_WHEN_INVALID
:
return
q_t
,
v_t
,
a_t
else
:
print
"
Try new end effector trajectory.
"
for
eeName
,
oldTraj
in
dic_effectors_trajs
.
iteritems
():
if
oldTraj
:
# update the traj in the map
ref_traj
=
generateEEReferenceTrajCollisionFree
(
fullBody
,
robot
,
invdyn
.
data
(),
t_begin
,
phase_prev
,
phase
,
phase_next
,
q_t_phase
,
oldTraj
,
eeName
,
pid
,
viewer
)
dic_effectors_trajs
.
update
({
eeName
:
ref_traj
})
else
:
# no effector motions, phase always valid (or bypass the check)
phaseValid
=
True
if
cfg
.
WB_VERBOSE
:
print
"
Phase
"
+
str
(
pid
)
+
"
valid.
"
...
...
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