Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to display urdf visualization #14

Open
victorozoh opened this issue Aug 18, 2020 · 3 comments
Open

Failure to display urdf visualization #14

victorozoh opened this issue Aug 18, 2020 · 3 comments

Comments

@victorozoh
Copy link

victorozoh commented Aug 18, 2020

Hi,

Thanks for the effort you guys put into making urdfpy.
I am getting errors for the following code sample executing on Python 3. I installed urdfpy into my python3 environment.


from urdfpy import URDF
robot = URDF.load('ur5/ur5.urdf')

robot.show(cfg={'shoulder_lift_joint':-2.0, 'elbow_joint':2.0})

Error:
urdf_test_error

I made certain that the 'robot' variable gets a value from the URDF.load() function.
I'd greatly appreciate your thoughts on how to fix this.

@qiuwch
Copy link

qiuwch commented Sep 8, 2020

This seems to be an issue caused by trimesh.
If I use pip install trimesh==3.7.13 it works fine.
But 3.7.14 fails.

@bearpaw
Copy link

bearpaw commented Jul 7, 2021

Install pyrender from the source https://github.com/mmatl/pyrender.git resolves this issue.

@im44pos
Copy link

im44pos commented Nov 25, 2022

I have trimesh 3.16.4, pyrender 0.1.45 in a python 3.8 jupyter notebook on windows10 and get:
IndexError: index 0 is out of bounds for axis 0 with size 0


IndexError Traceback (most recent call last)
Cell In [13], line 1
----> 1 robot.show( cfg = {
2 'shoulder_lift_joint': -2.0,
3 'elbow_joint': 2.0
4 })

File C:\ProgramFiles\Anaconda\envs\robot_urdf\lib\site-packages\urdfpy\urdf.py:3570, in URDF.show(self, cfg, use_collision)
3568 for tm in fk:
3569 pose = fk[tm]
-> 3570 mesh = pyrender.Mesh.from_trimesh(tm, smooth=False)
3571 scene.add(mesh, pose=pose)
3572 pyrender.Viewer(scene, use_raymond_lighting=True)

File C:\ProgramFiles\Anaconda\envs\robot_urdf\lib\site-packages\pyrender\mesh.py:209, in Mesh.from_trimesh(mesh, material, is_visible, poses, wireframe, smooth)
206 normals = np.repeat(m.face_normals, 3, axis=0)
208 # Compute colors, texture coords, and material properties
--> 209 color_0, texcoord_0, primitive_material = Mesh._get_trimesh_props(m, smooth=smooth, material=material)
211 # Override if material is given.
212 if material is not None:
213 #primitive_material = copy.copy(material)

File C:\ProgramFiles\Anaconda\envs\robot_urdf\lib\site-packages\pyrender\mesh.py:291, in Mesh._get_trimesh_props(mesh, smooth, material)
289 texcoords = uv
290 else:
--> 291 texcoords = uv[mesh.faces].reshape(
292 (3 * len(mesh.faces), uv.shape[1])
293 )
295 if material is None:
296 # Configure mesh material
297 mat = mesh.visual.material

IndexError: index 0 is out of bounds for axis 0 with size 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants