From c6350bcc38efa0c0284ce58d2c76c59a3929f980 Mon Sep 17 00:00:00 2001 From: Qbotics Labs Date: Sat, 11 Feb 2023 03:03:22 -0800 Subject: [PATCH] Fix for AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. --- src/ros_numpy/point_cloud2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ros_numpy/point_cloud2.py b/src/ros_numpy/point_cloud2.py index a4e20ec..7c861a9 100755 --- a/src/ros_numpy/point_cloud2.py +++ b/src/ros_numpy/point_cloud2.py @@ -221,7 +221,7 @@ def split_rgb_field(cloud_arr): new_cloud_arr[field_name] = cloud_arr[field_name] return new_cloud_arr -def get_xyz_points(cloud_array, remove_nans=True, dtype=np.float): +def get_xyz_points(cloud_array, remove_nans=True, dtype=float): '''Pulls out x, y, and z columns from the cloud recordarray, and returns a 3xN matrix. '''