Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

Commit f18910e

Browse files
committed
fixed wrong point clound size info
1 parent c0742b9 commit f18910e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/k4a_ros_device.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,10 @@ k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_imag
692692

693693
pcd_modifier.resize(point_count);
694694

695+
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
696+
point_cloud->height = pointcloud_image.get_height_pixels();
697+
point_cloud->width = pointcloud_image.get_width_pixels();
698+
695699
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
696700
const uint8_t* color_buffer = color_image.get_buffer();
697701

@@ -740,6 +744,10 @@ k4a_result_t K4AROSDevice::fillPointCloud(const k4a::image& pointcloud_image, se
740744

741745
pcd_modifier.resize(point_count);
742746

747+
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
748+
point_cloud->height = pointcloud_image.get_height_pixels();
749+
point_cloud->width = pointcloud_image.get_width_pixels();
750+
743751
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
744752

745753
for (size_t i = 0; i < point_count; i++, ++iter_x, ++iter_y, ++iter_z)

0 commit comments

Comments
 (0)