Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depth_image_proc/point_cloud_xyzi_radial Add intensity conversion (copy) for float #336

Merged
merged 2 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions depth_image_proc/src/nodelets/point_cloud_xyzi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ void PointCloudXyziNodelet::imageCb(const sensor_msgs::ImageConstPtr& depth_msg,
{
convert<uint16_t, uint16_t>(depth_msg, intensity_msg, cloud_msg);
}
else if (depth_msg->encoding == enc::TYPE_16UC1 &&
intensity_msg->encoding == enc::TYPE_32FC1)
{
convert<uint16_t,float>(depth_msg, intensity_msg, cloud_msg);
}
else if (depth_msg->encoding == enc::TYPE_32FC1 &&
intensity_msg->encoding == enc::MONO8)
{
Expand All @@ -249,6 +254,11 @@ void PointCloudXyziNodelet::imageCb(const sensor_msgs::ImageConstPtr& depth_msg,
{
convert<float, uint16_t>(depth_msg, intensity_msg, cloud_msg);
}
else if (depth_msg->encoding == enc::TYPE_32FC1 &&
intensity_msg->encoding == enc::TYPE_32FC1)
{
convert<float,float>(depth_msg, intensity_msg, cloud_msg);
}
else
{
NODELET_ERROR_THROTTLE(5, "Depth image has unsupported encoding [%s]", depth_msg->encoding.c_str());
Expand Down
4 changes: 4 additions & 0 deletions depth_image_proc/src/nodelets/point_cloud_xyzi_radial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ namespace depth_image_proc {
{
convert_intensity<uint8_t>(intensity_msg, cloud_msg);
}
else if(intensity_msg->encoding == enc::TYPE_32FC1)
{
convert_intensity<float>(intensity_msg, cloud_msg);
}
else
{
NODELET_ERROR_THROTTLE(5, "Intensity image has unsupported encoding [%s]", intensity_msg->encoding.c_str());
Expand Down