Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-pattern-generator
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
Olivier Stasse
sot-pattern-generator
Commits
fa6b022d
Commit
fa6b022d
authored
8 years ago
by
Rohan Budhiraja
Browse files
Options
Downloads
Patches
Plain Diff
[python] add tutorial script for simple walking motion generation
parent
751a9d4a
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
python/kineromeo.py
+103
-0
103 additions, 0 deletions
python/kineromeo.py
with
103 additions
and
0 deletions
python/kineromeo.py
0 → 100644
+
103
−
0
View file @
fa6b022d
# ______________________________________________________________________________
# ******************************************************************************
# A simple Herdt walking pattern generator for ROMEO.
# ______________________________________________________________________________
# ******************************************************************************
#----------------CUSTOM-------------------------------#
#------SET THESE VALUES FOR YOUR ROBOT----------------#
dt
=
5e-3
_urdfPath
=
"
~/git/sot/pinocchio/models/romeo.urdf
"
_srdfPath
=
"
~/git/laas/romeo/romeo_description/srdf/romeo.srdf
"
_urdfDir
=
[
"
~/git/sot/pinocchio/models
"
]
_robotName
=
'
ROMEO
'
_OperationalPointsMap
=
{
'
left-wrist
'
:
'
LWristPitch
'
,
'
right-wrist
'
:
'
RWristPitch
'
,
'
left-ankle
'
:
'
LAnkleRoll
'
,
'
right-ankle
'
:
'
RAnkleRoll
'
,
'
gaze
'
:
'
HeadRoll
'
,
'
waist
'
:
'
root_joint
'
,
'
chest
'
:
'
TrunkYaw
'
}
_initialConfig
=
(
0
,
0
,
.
840252
,
0
,
0
,
0
,
# FF
0
,
0
,
-
0.3490658
,
0.6981317
,
-
0.3490658
,
0
,
# LLEG
0
,
0
,
-
0.3490658
,
0.6981317
,
-
0.3490658
,
0
,
# RLEG
0
,
# TRUNK
1.5
,
0.6
,
-
0.5
,
-
1.05
,
-
0.4
,
-
0.3
,
-
0.2
,
# LARM
0
,
0
,
0
,
0
,
# HEAD
1.5
,
-
0.6
,
0.5
,
1.05
,
-
0.4
,
-
0.3
,
-
0.2
,
# RARM
)
#----------------PINOCCHIO----------------------------#
import
pinocchio
as
se3
from
pinocchio.robot_wrapper
import
RobotWrapper
pinocchioRobot
=
RobotWrapper
(
_urdfPath
,
_urdfDir
,
se3
.
JointModelFreeFlyer
())
pinocchioRobot
.
initDisplay
(
loadModel
=
True
)
#----------------ROBOT - DEVICE AND DYNAMICS----------#
from
dynamic_graph.sot.dynamics.humanoid_robot
import
HumanoidRobot
robot
=
HumanoidRobot
(
_robotName
,
pinocchioRobot
.
model
,
pinocchioRobot
.
data
,
_initialConfig
,
_OperationalPointsMap
)
#-----------------------------------------------------#
#----------------SOT (SOLVER)-------------------------#
from
dynamic_graph.sot.application.velocity.precomputed_tasks
import
initialize
solver
=
initialize
(
robot
)
#-----------------------------------------------------#
#----------------PG--------------------------------#
from
dynamic_graph.sot.pattern_generator
import
PatternGenerator
,
Selector
from
dynamic_graph.sot.pattern_generator.walking
import
initPg
,
initZMPRef
,
initWaistCoMTasks
,
initFeetTask
,
initPostureTask
,
pushTasks
,
walkNaveau
#CreateEverythingForPG ( robot , sot , dyn )
robot
.
initializeTracer
()
robot
.
pg
=
PatternGenerator
(
'
pg
'
)
robot
.
pg
.
setURDFpath
(
_urdfPath
)
robot
.
pg
.
setSRDFpath
(
_srdfPath
)
robot
.
pg
.
buildModel
()
initPg
(
robot
)
#createGraph(robot,solver
robot
.
dynamic
.
createOpPoint
(
'
rf2
'
,
robot
.
OperationalPointsMap
[
'
right-ankle
'
])
robot
.
dynamic
.
createOpPoint
(
'
lf2
'
,
robot
.
OperationalPointsMap
[
'
left-ankle
'
])
initZMPRef
(
robot
)
initWaistCoMTasks
(
robot
)
initFeetTask
(
robot
)
initPostureTask
(
robot
)
pushTasks
(
robot
,
solver
)
#------------------------------------------------#
# walkFewSteps ( robot )
walkNaveau
(
robot
)
robot
.
pg
.
velocitydes
.
value
=
(
0.1
,
0.0
,
0.0
)
#-------------------------------------------------------------------------------
#----- MAIN LOOP ---------------------------------------------------------------
#-------------------------------------------------------------------------------
from
dynamic_graph.sot.dynamics
import
fromSotToPinocchio
def
inc
():
robot
.
device
.
increment
(
dt
)
#print robot.device.state.value
pinocchioRobot
.
display
(
fromSotToPinocchio
(
robot
.
device
.
state
.
value
))
def
runner
(
n
):
for
i
in
xrange
(
n
):
inc
()
robot
.
stopTracer
()
# --- HERDT PG AND START -------------------------------------------------------
# Set the algorithm generating the ZMP reference trajectory to Herdt's one.
# pg.startHerdt(False)
print
(
'
You can now modifiy the speed of the robot by setting pg.pg.velocitydes
'
)
print
(
'
example : robot.pg.velocitydes.value =(0.1,0.0,0.0)
\n
'
)
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