From e13a054ba38bdf871b3b0a7975527b99ae6e3edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Wed, 24 Jan 2024 15:24:25 +0100 Subject: [PATCH] Fixed image types in depth_image_proc 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_xyzrgb.cpp | 4 ++++ depth_image_proc/src/point_cloud_xyzrgb_radial.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/depth_image_proc/src/point_cloud_xyzrgb.cpp b/depth_image_proc/src/point_cloud_xyzrgb.cpp index 52dce4166..3347b11e1 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb.cpp @@ -270,6 +270,10 @@ void PointCloudXyzrgbNode::imageCb( convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else if (rgb_msg->encoding == sensor_msgs::image_encodings::BGR8) { convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); + } else if (rgb_msg->encoding == sensor_msgs::image_encodings::BGRA8) { + convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); + } else if (rgb_msg->encoding == sensor_msgs::image_encodings::RGBA8) { + convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else if (rgb_msg->encoding == sensor_msgs::image_encodings::MONO8) { convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else { diff --git a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp index 5211d9754..7d2c92477 100644 --- a/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp +++ b/depth_image_proc/src/point_cloud_xyzrgb_radial.cpp @@ -265,6 +265,10 @@ void PointCloudXyzrgbRadialNode::imageCb( convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else if (rgb_msg->encoding == sensor_msgs::image_encodings::BGR8) { convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); + } else if (rgb_msg->encoding == sensor_msgs::image_encodings::BGRA8) { + convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); + } else if (rgb_msg->encoding == sensor_msgs::image_encodings::RGBA8) { + convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else if (rgb_msg->encoding == sensor_msgs::image_encodings::MONO8) { convertRgb(rgb_msg, cloud_msg, red_offset, green_offset, blue_offset, color_step); } else {