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

Chakio/melodic/feature implement improve get rgb point cloud in depth frame #4

Open
wants to merge 11 commits into
base: chakio/melodic/devel
Choose a base branch
from
17 changes: 16 additions & 1 deletion src/k4a_ros_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,22 @@ k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_imag
if (z <= 0.0f || a == 0)
{
*iter_x = *iter_y = *iter_z = std::numeric_limits<float>::quiet_NaN();
*iter_r = *iter_g = *iter_b = 0;
if (a == 0)
{
// ROS_WARN("a == 0");
*iter_r = color_buffer[4 * i + 2];
*iter_g = color_buffer[4 * i + 1];
*iter_b = color_buffer[4 * i + 0];
// printf("r=[%5f], g=[%2f], b=[%1f]",color_buffer[4 * i + 2], color_buffer[4 * i + 1], color_buffer[4 * i + 0]);
}
else
{
*iter_r = color_buffer[4 * i + 2];
*iter_g = color_buffer[4 * i + 1];
*iter_b = color_buffer[4 * i + 0];
// printf("r=[%5f], g=[%1f], b=[%1f]",color_buffer[4 * i + 2], color_buffer[4 * i + 1], color_buffer[4 * i + 0]);
}

}
else
{
Expand Down