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

AttributeError: module 'numpy' has no attribute 'float' #45

Closed
stephane-caron opened this issue Dec 19, 2022 · 0 comments
Closed

AttributeError: module 'numpy' has no attribute 'float' #45

stephane-caron opened this issue Dec 19, 2022 · 0 comments
Assignees

Comments

@stephane-caron
Copy link
Contributor

Loading a URDF with numpy>=1.24.0 fails because np.float was deprecated and has disappeared:

$ python
Python 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 15:55:03) 
[GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yourdfpy
>>> yourdfpy.URDF.load(".../any.urdf")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 989, in load
    return URDF(robot=URDF._parse_robot(xml_element=xml_root), **kwargs)
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 2154, in _parse_robot
    robot.links.append(URDF._parse_link(l))
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 1951, in _parse_link
    link.visuals.append(URDF._parse_visual(v))
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 1819, in _parse_visual
    visual.geometry = URDF._parse_geometry(xml_element.find("geometry"))
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 1683, in _parse_geometry
    geometry.box = URDF._parse_box(xml_element[0])
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/yourdfpy/urdf.py", line 1621, in _parse_box
    return Box(size=np.array(xml_element.attrib["size"].split(), dtype=np.float))
  File "/.../.micromamba/envs/yourdfpy-test/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'
stephane-caron added a commit to robot-descriptions/robot_descriptions.py that referenced this issue Dec 19, 2022
stephane-caron added a commit to robot-descriptions/robot_descriptions.py that referenced this issue Jan 12, 2023
stephane-caron added a commit to robot-descriptions/robot_descriptions.py that referenced this issue Jan 13, 2023
@clemense clemense self-assigned this Dec 17, 2023
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

2 participants