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
0d12f01f
Commit
0d12f01f
authored
8 years ago
by
jcarpent
Committed by
Valenza Florian
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Python] Update robot_wrapper to allow proper creation of scenes
parent
3787d792
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
bindings/python/robot_wrapper.py
+16
-12
16 additions, 12 deletions
bindings/python/robot_wrapper.py
with
16 additions
and
12 deletions
bindings/python/robot_wrapper.py
+
16
−
12
View file @
0d12f01f
...
...
@@ -154,29 +154,33 @@ class RobotWrapper(object):
# Create the scene displaying the robot meshes in gepetto-viewer
def
loadDisplayModel
(
self
,
nodeName
,
windowName
=
"
pinocchio
"
):
import
os
print
"
load the model
"
# Open a window for displaying your model.
try
:
# If the window already exists, do not do anything.
self
.
windowID
=
self
.
viewer
.
gui
.
getWindowID
(
windowName
)
print
"
Warning: window
'
%s
'
already created. Cannot (re-)load the model.
"
%
windowName
return
except
:
# Otherwise, create the empty window.
self
.
windowID
=
self
.
viewer
.
gui
.
createWindow
(
windowName
)
# Start a new "scene" in this window, named "world", with just a floor.
self
.
viewer
.
gui
.
createSceneWithFloor
(
"
world
"
)
self
.
viewer
.
gui
.
addSceneToWindow
(
"
world
"
,
self
.
windowID
)
# Start a new "scene" in this window, named "world", with just a floor.
gui
=
self
.
viewer
.
gui
scene_l
=
gui
.
getSceneList
()
if
"
world
"
not
in
scene_l
:
self
.
viewer
.
gui
.
createScene
(
"
world
"
)
self
.
viewer
.
gui
.
addSceneToWindow
(
"
world
"
,
self
.
windowID
)
self
.
viewer
.
gui
.
createGroup
(
nodeName
)
self
.
viewer
.
gui
.
createGroup
(
nodeName
)
# iterate over visuals and create the meshes in the viewer
for
visual
in
self
.
visual_model
.
geometryObjects
:
meshName
=
self
.
viewerNodeNames
(
visual
)
meshPath
=
visual
.
mesh_path
self
.
viewer
.
gui
.
addMesh
(
meshName
,
meshPath
)
# iterate over visuals and create the meshes in the viewer
for
visual
in
self
.
visual_model
.
geometryObjects
:
meshName
=
self
.
viewerNodeNames
(
visual
)
meshPath
=
visual
.
mesh_path
self
.
viewer
.
gui
.
addMesh
(
meshName
,
meshPath
)
# Finally, refresh the layout to obtain your first rendering.
self
.
viewer
.
gui
.
refresh
()
# Finally, refresh the layout to obtain your first rendering.
self
.
viewer
.
gui
.
refresh
()
# Display in gepetto-view the robot at configuration q, by placing all the bodies.
...
...
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