Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-rbprm-corba
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
Jason Chemin
hpp-rbprm-corba
Commits
67fc6dba
Commit
67fc6dba
authored
6 years ago
by
Pierre Fernbach
Browse files
Options
Downloads
Patches
Plain Diff
[script] add a script for kinodynamic planner with talos
parent
288e92af
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
script/scenarios/demos/talos_flatGround_path.py
+96
-0
96 additions, 0 deletions
script/scenarios/demos/talos_flatGround_path.py
with
96 additions
and
0 deletions
script/scenarios/demos/talos_flatGround_path.py
0 → 100644
+
96
−
0
View file @
67fc6dba
from
hpp.corbaserver.rbprm.rbprmbuilder
import
Builder
from
hpp.gepetto
import
Viewer
from
hpp.corbaserver
import
Client
from
hpp.corbaserver
import
ProblemSolver
import
time
rootJointType
=
'
freeflyer
'
packageName
=
'
talos-rbprm
'
meshPackageName
=
'
talos-rbprm
'
urdfName
=
'
talos_trunk
'
urdfNameRom
=
[
'
talos_larm_rom
'
,
'
talos_rarm_rom
'
,
'
talos_lleg_rom
'
,
'
talos_rleg_rom
'
]
urdfSuffix
=
""
srdfSuffix
=
""
vMax
=
0.3
aMax
=
0.1
extraDof
=
6
mu
=
0.5
# Creating an instance of the helper class, and loading the robot
rbprmBuilder
=
Builder
()
rbprmBuilder
.
loadModel
(
urdfName
,
urdfNameRom
,
rootJointType
,
meshPackageName
,
packageName
,
urdfSuffix
,
srdfSuffix
)
rbprmBuilder
.
setJointBounds
(
"
root_joint
"
,
[
-
5
,
5
,
-
1.5
,
1.5
,
0.95
,
1.05
])
# The following lines set constraint on the valid configurations:
# a configuration is valid only if all limbs can create a contact ...
rbprmBuilder
.
setFilter
([
'
talos_lleg_rom
'
,
'
talos_rleg_rom
'
])
rbprmBuilder
.
setAffordanceFilter
(
'
talos_lleg_rom
'
,
[
'
Support
'
,])
rbprmBuilder
.
setAffordanceFilter
(
'
talos_rleg_rom
'
,
[
'
Support
'
])
# We also bound the rotations of the torso. (z, y, x)
rbprmBuilder
.
boundSO3
([
-
1.7
,
1.7
,
-
0.1
,
0.1
,
-
0.1
,
0.1
])
rbprmBuilder
.
client
.
robot
.
setDimensionExtraConfigSpace
(
extraDof
)
rbprmBuilder
.
client
.
robot
.
setExtraConfigSpaceBounds
([
-
vMax
,
vMax
,
-
vMax
,
vMax
,
0
,
0
,
-
aMax
,
aMax
,
-
aMax
,
aMax
,
0
,
0
])
indexECS
=
rbprmBuilder
.
getConfigSize
()
-
rbprmBuilder
.
client
.
robot
.
getDimensionExtraConfigSpace
()
# Creating an instance of HPP problem solver and the viewer
ps
=
ProblemSolver
(
rbprmBuilder
)
ps
.
setParameter
(
"
Kinodynamic/velocityBound
"
,
vMax
)
ps
.
setParameter
(
"
Kinodynamic/accelerationBound
"
,
aMax
)
ps
.
setParameter
(
"
DynamicPlanner/sizeFootX
"
,
0.2
)
ps
.
setParameter
(
"
DynamicPlanner/sizeFootY
"
,
0.12
)
ps
.
setParameter
(
"
DynamicPlanner/friction
"
,
0.5
)
ps
.
setParameter
(
"
ConfigurationShooter/sampleExtraDOF
"
,
False
)
from
hpp.gepetto
import
ViewerFactory
vf
=
ViewerFactory
(
ps
)
from
hpp.corbaserver.affordance.affordance
import
AffordanceTool
afftool
=
AffordanceTool
()
afftool
.
setAffordanceConfig
(
'
Support
'
,
[
0.5
,
0.03
,
0.00005
])
afftool
.
loadObstacleModel
(
"
hpp-rbprm-corba
"
,
"
ground
"
,
"
planning
"
,
vf
)
v
=
vf
.
createViewer
(
displayArrows
=
True
)
afftool
.
visualiseAffordances
(
'
Support
'
,
v
,
v
.
color
.
lightBrown
)
# Setting initial configuration
q_init
=
rbprmBuilder
.
getCurrentConfig
();
q_init
[
3
:
7
]
=
[
0
,
0
,
0
,
1
]
q_init
[
0
:
3
]
=
[
0
,
0
,
1.
]
v
(
q_init
)
# set goal config
rbprmBuilder
.
setCurrentConfig
(
q_init
)
q_goal
=
q_init
[::]
q_goal
[
0
]
=
1.5
v
(
q_goal
)
ps
.
setInitialConfig
(
q_init
)
ps
.
addGoalConfig
(
q_goal
)
# Choosing RBPRM shooter and path validation methods.
ps
.
selectConfigurationShooter
(
"
RbprmShooter
"
)
ps
.
addPathOptimizer
(
"
RandomShortcutDynamic
"
)
ps
.
selectPathValidation
(
"
RbprmPathValidation
"
,
0.05
)
# Choosing kinodynamic methods :
ps
.
selectSteeringMethod
(
"
RBPRMKinodynamic
"
)
ps
.
selectDistance
(
"
Kinodynamic
"
)
ps
.
selectPathPlanner
(
"
DynamicPlanner
"
)
t
=
ps
.
solve
()
print
"
Guide planning time :
"
,
t
# display solution :
from
hpp.gepetto
import
PathPlayer
pp
=
PathPlayer
(
v
)
pp
.
dt
=
0.03
pp
.
displayVelocityPath
(
0
)
v
.
client
.
gui
.
setVisibility
(
"
path_0_root
"
,
"
ALWAYS_ON_TOP
"
)
pp
(
0
)
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