Commit 49d2a9c7 authored by Gabriele Buondonno's avatar Gabriele Buondonno
Browse files

[examples/meshcat-viewer.py] Prevent exceptions

parent 3752ace8
......@@ -5,6 +5,7 @@
import pinocchio as pin
pin.switchToNumpyMatrix()
import numpy as np
import sys
import os
try:
......@@ -32,7 +33,12 @@ viz = MeshcatVisualizer(model, collision_model, visual_model)
#
# Option open=True pens the visualizer.
# Note: the visualizer can also be opened seperately by visiting the provided URL.
viz.initViewer(open=True)
try:
viz.initViewer(open=True)
except ImportError as err:
print("Error while initializing the viewer. It seems you should install Python meshcat")
print(err)
sys.exit(0)
input("Press enter to continue")
......
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