From 27de1141d1afdf29c737a94b03aba961fd1fb18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 19 Jan 2024 15:21:18 +0100 Subject: [PATCH] ROS 2: depth_image_proc/point_cloud_xyzi_radial Add intensity conversion (copy) for float (#867) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ported from ROS 1 https://github.com/ros-perception/image_pipeline/pull/336/files 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 0a75c82e2..f0b8d17f7 100644 --- a/depth_image_proc/src/point_cloud_xyzi.cpp +++ b/depth_image_proc/src/point_cloud_xyzi.cpp @@ -214,6 +214,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 313826bfd..c873993c2 100644 --- a/depth_image_proc/src/point_cloud_xyzi_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzi_radial.cpp @@ -157,6 +157,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]",