Commit 50329b98 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[examples/display_shapes] Include in CI

parent ba2821b3
......@@ -50,6 +50,7 @@ IF(BUILD_PYTHON_INTERFACE)
LIST(APPEND ${PROJECT_NAME}_PYTHON_EXAMPLES
collisions
sample-model-viewer
display_shapes
)
ENDIF(HPP_FCL_FOUND)
......
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))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment