From ebaed94064ab250fb6a132ca34e49f6e16658fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 19 Jan 2024 13:29:56 +0100 Subject: [PATCH] ROS 2: depth_image_proc/point_cloud_xyzi_radial Add intensity conversion (copy) for float MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- depth_image_proc/src/point_cloud_xyzi.cpp | 2 ++ depth_image_proc/src/point_cloud_xyzi_radial.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/depth_image_proc/src/point_cloud_xyzi.cpp b/depth_image_proc/src/point_cloud_xyzi.cpp index 51f1bec68..78d07d1a0 100644 --- a/depth_image_proc/src/point_cloud_xyzi.cpp +++ b/depth_image_proc/src/point_cloud_xyzi.cpp @@ -205,6 +205,8 @@ void PointCloudXyziNode::imageCb( convertIntensity(intensity_msg, cloud_msg); } else if (intensity_msg->encoding == enc::TYPE_16UC1) { convertIntensity(intensity_msg, cloud_msg); + } else if (intensity_msg->encoding == enc::TYPE_32FC1) { + convertIntensity(intensity_msg, cloud_msg); } else { RCLCPP_ERROR( get_logger(), "Intensity image has unsupported encoding [%s]", diff --git a/depth_image_proc/src/point_cloud_xyzi_radial.cpp b/depth_image_proc/src/point_cloud_xyzi_radial.cpp index a838bc58d..0f38b03e0 100644 --- a/depth_image_proc/src/point_cloud_xyzi_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzi_radial.cpp @@ -145,6 +145,8 @@ void PointCloudXyziRadialNode::imageCb( convertIntensity(intensity_msg, cloud_msg); } else if (intensity_msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1) { convertIntensity(intensity_msg, cloud_msg); + } else if (intensity_msg->encoding == sensor_msgs::image_encodings::TYPE_32FC1) { + convertIntensity(intensity_msg, cloud_msg); } else { RCLCPP_ERROR( get_logger(), "Intensity image has unsupported encoding [%s]",