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

Trying to access the meshes attribute of Cylinder throws an error. #20

Open
manuelli opened this issue Aug 20, 2021 · 4 comments
Open

Comments

@manuelli
Copy link

manuelli commented Aug 20, 2021

If g = Cylinder(1.0, 2.0) and you try to access the g.meshes field then it throws the following error

File "/usr/local/lib/python3.6/dist-packages/urdfpy/urdf.py", line 398, in meshes
    if len(self._meshes) == 0:
TypeError: object of type 'NoneType' has no len()

This is because self._meshes got initialize to self._meshes = None on this line instead of self._meshes = [] like in the other primitive types, e.g. Box. Should be a simple fix to just set self._meshes = [] in the Cylinder constructor.

@miker2
Copy link

miker2 commented Feb 9, 2023

This appears to be fixed on the tip of master. @mmatl Any chance we can bump the version and push a new package to pypi so this is fixed in the versions installed via pip or conda?

@traversaro
Copy link

@miker2 for what regard the conda-forge build, if you have any idea of what is the commit that fixed the issue we can try to backport it on the top of the latest release, as we did for another issue (#27) in https://github.com/conda-forge/urdfpy-feedstock/pull/3/files .

@adamconkey
Copy link

@traversaro I believe it's this commit that resolves the problem: 5466842

I verified that installing from source from the master branch resolved the problem for me.

@traversaro
Copy link

@traversaro I believe it's this commit that resolves the problem: 5466842

I verified that installing from source from the master branch resolved the problem for me.

Ok, I opened a PR to backport the fix in the conda-forge released version in conda-forge/urdfpy-feedstock#5, thanks!

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