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
Guilhem Saurel
pinocchio
Commits
3f2cd506
Commit
3f2cd506
authored
Jun 08, 2017
by
jcarpent
Browse files
[Examples] Add example on how to load a Romeo with Python
parent
08e3a703
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/python/README.md
0 → 100644
View file @
3f2cd506
# Pinocchio examples in Python
This directory contains minimal examples on how to use
**Pinocchio**
with the Python bindings.
examples/python/load-romeo.py
0 → 100755
View file @
3f2cd506
import
pinocchio
as
pin
from
pinocchio.romeo_wrapper
import
RomeoWrapper
## Load Romeo with RomeoWrapper
import
os
current_path
=
os
.
getcwd
()
# The model of Romeo is contained in the path PINOCCHIO_GIT_REPOSITORY/models/romeo
model_path
=
current_path
+
"/"
+
"../../models/romeo"
mesh_dir
=
model_path
urdf_filename
=
"romeo.urdf"
urdf_model_path
=
model_path
+
"/urdf/"
+
urdf_filename
robot
=
RomeoWrapper
(
urdf_model_path
,
[
mesh_dir
])
## alias
model
=
robot
.
model
data
=
robot
.
data
## do whatever, e.g. compute the center of mass position in the world frame
q0
=
robot
.
q0
com
=
robot
.
com
(
q0
)
# This last command is similar to
com2
=
pin
.
centerOfMass
(
model
,
data
,
q0
)
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