dfki-ric / pytransform3d

3D transformations for Python.
https://dfki-ric.github.io/pytransform3d/
Other
615 stars 63 forks source link

Problem with ploting visuals of UR5 mesh #270

Closed vojtooo closed 1 year ago

vojtooo commented 1 year ago

Hi,

I am trying to plot a mesh of UR5 robot.

I have provided the package_dir to the UrdfTransformManager.load_urdf function, which loads my urdf. I can plot the frames or connections with no problem. But I cannot plot the visuals.

I have checked that the obj.filename is correctly set to .../universal_robot/ur_description/meshes/ur5/visual/base.dae

ax = tm.plot_visuals("base_link", ax=ax)

File ".../pytransform3d/_mesh_loader.py", line 139, in convex_hull
    self.mesh = self.mesh.compute_convex_hull()[0]
RuntimeError: QH6412 qhull input error (qh_initqhull_globals): expecting between 1 and 2147483631 points.  Got 0 3-d points

While executing:  | qhull Qt
Options selected for Qhull 2020.2.r 2020/08/31:
  run-id 2047138174  Qtriangulate  _maxoutside  0

If I try to disable the convex hull

ax = tm.plot_visuals("base_link", ax=ax, convex_hull_of_mesh=False)

File ".../mpl_toolkits/mplot3d/art3d.py", line 890, in __init__
    raise ValueError('verts must be a list of (N, 3) array-like')
ValueError: verts must be a list of (N, 3) array-like

Doy you have any idea what could be the cause?

AlexanderFabisch commented 1 year ago

Hi @vojtooo ,

it seems like Open3D failed to load the mesh correctly. Unfortunately, this happens sometimes. trimesh is usually able to handle these cases, so please try installing it (e.g., pip install trimesh). If this does not fix the error, please check if the mesh file is broken. You could use tools like meshlab or gmsh to open it.

vojtooo commented 1 year ago

Wonderful, installing trimesh and pycollada solved the issue.

Vielen Dank! :)

AlexanderFabisch commented 1 year ago

Great :)