Unverified Commit 155aba33 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #1134 from matthieuvigne/viewer_fcl_warning

Python: warn user when trying to display geometric primitive without HPP-FCL
parents 6593485f 774b743d
......@@ -91,6 +91,10 @@ class GepettoVisualizer(BaseVisualizer):
if WITH_HPP_FCL_BINDINGS and isinstance(geometry_object.geometry, hppfcl.ShapeBase):
success = self.loadPrimitive(meshName, geometry_object)
else:
if meshName == "":
msg = "Display of geometric primitives is supported only if pinocchio is build with HPP-FCL bindings."
warnings.warn(msg, category=UserWarning, stacklevel=2)
return
success = gui.addMesh(meshName, meshPath)
if not success:
return
......
......@@ -68,11 +68,13 @@ class MeshcatVisualizer(BaseVisualizer):
return obj
def loadMesh(self, geometry_object):
import meshcat.geometry
# Mesh path is empty if Pinocchio is built without HPP-FCL bindings
if geometry_object.meshPath == "":
msg = "Display of geometric primitives is supported only if pinocchio is build with HPP-FCL bindings."
warnings.warn(msg, category=UserWarning, stacklevel=2)
return None
# Get file type from filename extension.
......
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