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 <[email protected]>
  • Loading branch information
ahcorde committed Jan 19, 2024
1 parent 6d5edd8 commit 27de114
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 @@ -214,6 +214,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 @@ -157,6 +157,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 27de114

Please sign in to comment.