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

Commit 3e04c24

Browse files
committed
setting correct row_step
1 parent 11fcbb3 commit 3e04c24

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/k4a_ros_device.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_imag
695695
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
696696
point_cloud->height = pointcloud_image.get_height_pixels();
697697
point_cloud->width = pointcloud_image.get_width_pixels();
698+
point_cloud->row_step = pointcloud_image.get_width_pixels() * point_cloud->point_step;
698699

699700
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
700701
const uint8_t* color_buffer = color_image.get_buffer();
@@ -747,6 +748,7 @@ k4a_result_t K4AROSDevice::fillPointCloud(const k4a::image& pointcloud_image, se
747748
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
748749
point_cloud->height = pointcloud_image.get_height_pixels();
749750
point_cloud->width = pointcloud_image.get_width_pixels();
751+
point_cloud->row_step = pointcloud_image.get_width_pixels() * point_cloud->point_step;
750752

751753
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
752754

0 commit comments

Comments
 (0)