Skip to content

Commit

Permalink
ROS 2: depth_image_proc/point_cloud_xyzi_radial Add intensity convers…
Browse files Browse the repository at this point in the history
…ion (copy) for float (#867)

Ported from ROS 1
https://github.com/ros-perception/image_pipeline/pull/336/files

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Jan 19, 2024
1 parent e549e45 commit fe331c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions depth_image_proc/src/point_cloud_xyzi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ void PointCloudXyziNode::imageCb(
convertIntensity<uint16_t>(intensity_msg, cloud_msg);
} else if (intensity_msg->encoding == enc::TYPE_16UC1) {
convertIntensity<uint16_t>(intensity_msg, cloud_msg);
} else if (intensity_msg->encoding == enc::TYPE_32FC1) {
convertIntensity<float>(intensity_msg, cloud_msg);
} else {
RCLCPP_ERROR(
get_logger(), "Intensity image has unsupported encoding [%s]",
Expand Down
2 changes: 2 additions & 0 deletions depth_image_proc/src/point_cloud_xyzi_radial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ void PointCloudXyziRadialNode::imageCb(
convertIntensity<uint16_t>(intensity_msg, cloud_msg);
} else if (intensity_msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1) {
convertIntensity<uint16_t>(intensity_msg, cloud_msg);
} else if (intensity_msg->encoding == sensor_msgs::image_encodings::TYPE_32FC1) {
convertIntensity<float>(intensity_msg, cloud_msg);
} else {
RCLCPP_ERROR(
get_logger(), "Intensity image has unsupported encoding [%s]",
Expand Down

0 comments on commit fe331c1

Please sign in to comment.