Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
50329b98
Commit
50329b98
authored
Jan 08, 2020
by
Gabriele Buondonno
Browse files
[examples/display_shapes] Include in CI
parent
ba2821b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
examples/CMakeLists.txt
View file @
50329b98
...
...
@@ -50,6 +50,7 @@ IF(BUILD_PYTHON_INTERFACE)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_EXAMPLES
collisions
sample-model-viewer
display_shapes
)
ENDIF
(
HPP_FCL_FOUND
)
...
...
examples/display_shapes.py
View file @
50329b98
import
sys
import
numpy
as
np
import
pinocchio
as
pin
import
hppfcl
try
:
import
hppfcl
except
ImportError
:
print
(
"This example requires hppfcl"
)
sys
.
exit
(
0
)
from
pinocchio.visualize
import
GepettoVisualizer
pin
.
switchToNumpyArray
()
...
...
@@ -27,6 +32,19 @@ viz = GepettoVisualizer(
model
=
model
,
collision_model
=
geom_model
,
visual_model
=
geom_model
,
)
viz
.
initViewer
()
viz
.
loadViewerModel
(
"shapes"
)
# Initialize the viewer.
try
:
viz
.
initViewer
()
except
ImportError
:
print
(
"Error while initializing the viewer. It seems you should install gepetto-viewer"
)
print
(
err
)
sys
.
exit
(
0
)
try
:
viz
.
loadViewerModel
(
"shapes"
)
except
AttributeError
:
print
(
"Error while loading the viewer model. It seems you should start gepetto-viewer"
)
print
(
err
)
sys
.
exit
(
0
)
viz
.
display
(
np
.
zeros
(
0
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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