mmatl / urdfpy

Python parser for URDFs
http://urdfpy.readthedocs.io/
MIT License
224 stars 81 forks source link

fixed Cylinder meshes creation #6

Closed JorenVDL closed 2 years ago

JorenVDL commented 4 years ago

self._meshes was set to None instead of []. And in def meshes, self._mesh was returned instead of self._meshes

sthoduka commented 4 years ago

Thanks, this fixed the issue with loading my urdf as well. For reference, here is the error I get without this patch:

    robot.show()
  File "/home/ubuntu/apps/urdfpy/urdfpy/urdf.py", line 3543, in show
    fk = self.visual_trimesh_fk(cfg=cfg)
  File "/home/ubuntu/apps/urdfpy/urdfpy/urdf.py", line 3200, in visual_trimesh_fk
    for mesh in visual.geometry.meshes:
  File "/home/ubuntu/apps/urdfpy/urdfpy/urdf.py", line 736, in meshes
    return self.geometry.meshes
  File "/home/ubuntu/apps/urdfpy/urdfpy/urdf.py", line 396, in meshes
    if len(self._meshes) == 0:
TypeError: object of type 'NoneType' has no len()
lianghongzhuo commented 3 years ago

I can confirm this pull request fixed the problem. Please merge.