Closed LorenzoFiori closed 1 year ago
cc @Nicogene @CarlottaSartore
@LorenzoFiori could you please point me to the urdf file you are using? Thanks :) and also which version of Numpy you are using
I think that the issue lays in urdf py that when loads the color of a material does np.float()
in numpy 1.24 the alias np.float()
has been removed, which instead has been deprecated with numpy 1.22 (hence it gives a warning but still works).
So downgraded to numpy 1.22 should make it work
I think that the issue lays in urdf py that when loads the color of a material does
np.float()
in numpy 1.24 the aliasnp.float()
has been removed, which instead has been deprecated with numpy 1.22 (hence it gives a warning but still works).So downgraded to numpy 1.22 should make it work
For what regards conda-forge, I should have fixed this with https://github.com/conda-forge/urdfpy-feedstock/pull/4, as soon as CI passes I can merge and in ~10 minutes the new (fixed) package should be available. However, I have no control on the urdfpy package on PyPI.
More in general this is also related to https://github.com/icub-tech-iit/urdf-modifiers/issues/30 . The long term solution are discussed in https://github.com/icub-tech-iit/urdf-modifiers/issues/30#issuecomment-1364040962, but in the meanwhile we could modify the README to document this situation, and in particular document a way to avoid this problems (i.e. use conda-forge or use pip and pin numpy?).
Ok, the new urdfpy build pyha21a80b_2
is available in conda-forge, you should get it automatically if you create a new environment, or run mamba update urdfpy
in an existing environment.
Ok, the new urdfpy build
pyha21a80b_2
is available in conda-forge, you should get it automatically if you create a new environment, or runmamba update urdfpy
in an existing environment.
@LorenzoFiori can you try this and verify you are able to correctly load the model with the colour?
@CarlottaSartore and @traversaro thank you for your fast and helpful suggestions!
after upgrading within the existing environment with mamba update urdfpy
, it now load the model with the color (@lrapetti)
@CarlottaSartore although I think it is a little late in the day as an answer:
our urdf-model
e this is about Numpy:
Name: numpy
Version: 1.24.0
Summary: Fundamental package for array computing in Python
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email:
License: BSD-3-Clause
Location: C:\Users\lfiori\AppData\Local\mambaforge\envs\robsub\Lib\site-packages
Requires:
Required-by: contourpy, h5py, imageio, matplotlib, pycollada, pyrender, scipy, trimesh, urdfModifiers, urdfpy
Shall we enforce the numpy version in setup.cfg
?
Shall we enforce the numpy version in
setup.cfg
?
The problem is that would prevent to use urdf-modifiers with numpy==1.24.0 with dependencies provided by conda-forge, even if that is working fine.
Hi @traversaro @Nicogene, the issue for @LorenzoFiori seems to be resolved so feel free to close the issue for us.
I don't know if you took any decision concerning:
Shall we enforce the numpy version in
setup.cfg
?The problem is that would prevent to use urdf-modifiers with numpy==1.24.0 with dependencies provided by conda-forge, even if that is working fine.
I think the best option is to document the numpy constraint in the documentation that install the dependency via pip, but not enforce it in setup.cfg
.
Prompted by @Nicogene, I looked into updating the README, but then I tought it was a better use of time to just solve once and for all the problem of the unmantained urdfpy dependency. So, I decided that the fastest option was to go for option B in https://github.com/icub-tech-iit/urdf-modifiers/issues/30#issuecomment-1364040962, i.e. friendly fork urdfpy to a new library, and package that for PyPI. Exactly the second after I did this, I discovered that there was already a similar friendly fork at https://github.com/fishbotics/urchin, so let's check if we can converge to a single friendly fork, see also the discussion in https://github.com/mmatl/urdfpy/issues/31 .
Prompted by @Nicogene, I looked into updating the README, but then I tought it was a better use of time to just solve once and for all the problem of the unmantained urdfpy dependency. So, I decided that the fastest option was to go for option B in #30 (comment), i.e. friendly fork urdfpy to a new library, and package that for PyPI. Exactly the second after I did this, I discovered that there was already a similar friendly fork at https://github.com/fishbotics/urchin, so let's check if we can converge to a single friendly fork, see also the discussion in mmatl/urdfpy#31 .
The latest urchin 0.0.27 should work fine as a drop-in replacement of urdfpy, and soon it should be available in conda-forge : https://github.com/conda-forge/staged-recipes/pull/22592 . At this point, I think we can start migrating our projects from urdfpy to urchin, see for example https://github.com/icub-tech-iit/urdf-modifiers/pull/33 .
@lrapetti I open this issue to report a problem I had when using urdf-modifiers, specifically using the example Link and Joint Modifier.
Running this command from the terminal:
which contains the following modified script:
we get this error:
However, we were able to overcome this by removing this attribute from the `humanModelTemplate.urdf' (our model):
Unfortunately, both the original and modified models can no longer be opened with:
but must be added again manually the attribute.