eric-wieser/ros_numpy

ros_numpy broken with numpy 1.24 due to np.float

Magnusgaertner opened this issue · 1 comments

Issue

With numpy 1.24 np.float is no longer available, thus importing:

from ros_numpy.point_cloud2 import array_to_pointcloud2

breaks due to:

def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):

with something like:

  File "/opt/ros/noetic/lib/python3/dist-packages/ros_numpy/point_cloud2.py", line 224, in <module>
    def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float):
 <...>/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'

Suggestion to fix

A simple change to np.float32 should do it.

Closing, duplicate of #32