Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
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
Stack Of Tasks
pinocchio
Commits
3f2cd506
Commit
3f2cd506
authored
7 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Examples] Add example on how to load a Romeo with Python
parent
08e3a703
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/python/README.md
+3
-0
3 additions, 0 deletions
examples/python/README.md
examples/python/load-romeo.py
+24
-0
24 additions, 0 deletions
examples/python/load-romeo.py
with
27 additions
and
0 deletions
examples/python/README.md
0 → 100644
+
3
−
0
View file @
3f2cd506
# Pinocchio examples in Python
This directory contains minimal examples on how to use
**Pinocchio**
with the Python bindings.
This diff is collapsed.
Click to expand it.
examples/python/load-romeo.py
0 → 100755
+
24
−
0
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
)
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