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
08ab8ee2
Commit
08ab8ee2
authored
7 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Examples] Update python example
parent
fb16012c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/python/load-romeo.py
+18
-2
18 additions, 2 deletions
examples/python/load-romeo.py
with
18 additions
and
2 deletions
examples/python/load-romeo.py
+
18
−
2
View file @
08ab8ee2
import
pinocchio
as
pin
from
pinocchio.romeo_wrapper
import
RomeoWrapper
DISPLAY
=
False
## Load Romeo with RomeoWrapper
import
os
current_path
=
os
.
getcwd
()
...
...
@@ -8,8 +10,8 @@ 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
urdf_filename
=
"
romeo
_small
.urdf
"
urdf_model_path
=
model_path
+
"
/
romeo_description/
urdf/
"
+
urdf_filename
robot
=
RomeoWrapper
(
urdf_model_path
,
[
mesh_dir
])
...
...
@@ -22,3 +24,17 @@ q0 = robot.q0
com
=
robot
.
com
(
q0
)
# This last command is similar to
com2
=
pin
.
centerOfMass
(
model
,
data
,
q0
)
## load model into gepetto-gui
if
DISPLAY
:
import
gepetto.corbaserver
cl
=
gepetto
.
corbaserver
.
Client
()
gui
=
cl
.
gui
if
gui
.
nodeExists
(
"
world
"
):
gui
.
deleteNode
(
"
world
"
,
"
ON
"
)
robot
.
initDisplay
(
loadModel
=
False
)
robot
.
loadDisplayModel
(
"
pinocchio
"
)
robot
.
display
(
robot
.
q0
)
gui
=
robot
.
viewer
.
gui
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