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

Commit 11fcbb3

Browse files
committed
Reverted 9f77d19. Turned out the reader was broken.
This reverts commit 9f77d19.
1 parent 9f77d19 commit 11fcbb3

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/k4a_ros_device.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,8 @@ k4a_result_t K4AROSDevice::getPointCloud(const k4a::capture& capture, sensor_msg
666666
k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_image, const k4a::image& color_image,
667667
sensor_msgs::PointCloud2Ptr& point_cloud)
668668
{
669-
// Flip height and width to match expected memory layout
670-
point_cloud->height = pointcloud_image.get_width_pixels();
671-
point_cloud->width = pointcloud_image.get_height_pixels();
669+
point_cloud->height = pointcloud_image.get_height_pixels();
670+
point_cloud->width = pointcloud_image.get_width_pixels();
672671
point_cloud->is_dense = false;
673672
point_cloud->is_bigendian = false;
674673

@@ -694,9 +693,8 @@ k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_imag
694693
pcd_modifier.resize(point_count);
695694

696695
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
697-
point_cloud->height = pointcloud_image.get_width_pixels();
698-
point_cloud->width = pointcloud_image.get_height_pixels();
699-
point_cloud->row_step = pointcloud_image.get_height_pixels() * point_cloud->point_step;
696+
point_cloud->height = pointcloud_image.get_height_pixels();
697+
point_cloud->width = pointcloud_image.get_width_pixels();
700698

701699
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
702700
const uint8_t* color_buffer = color_image.get_buffer();
@@ -730,9 +728,8 @@ k4a_result_t K4AROSDevice::fillColorPointCloud(const k4a::image& pointcloud_imag
730728

731729
k4a_result_t K4AROSDevice::fillPointCloud(const k4a::image& pointcloud_image, sensor_msgs::PointCloud2Ptr& point_cloud)
732730
{
733-
// Flip height and width to match expected memory layout
734-
point_cloud->height = pointcloud_image.get_width_pixels();
735-
point_cloud->width = pointcloud_image.get_height_pixels();
731+
point_cloud->height = pointcloud_image.get_height_pixels();
732+
point_cloud->width = pointcloud_image.get_width_pixels();
736733
point_cloud->is_dense = false;
737734
point_cloud->is_bigendian = false;
738735

@@ -748,9 +745,8 @@ k4a_result_t K4AROSDevice::fillPointCloud(const k4a::image& pointcloud_image, se
748745
pcd_modifier.resize(point_count);
749746

750747
// Restore actual dimensions as pcd_modifier.resize(n) sets the cloud size to n x 1
751-
point_cloud->height = pointcloud_image.get_width_pixels();
752-
point_cloud->width = pointcloud_image.get_height_pixels();
753-
point_cloud->row_step = pointcloud_image.get_height_pixels() * point_cloud->point_step;
748+
point_cloud->height = pointcloud_image.get_height_pixels();
749+
point_cloud->width = pointcloud_image.get_width_pixels();
754750

755751
const int16_t* point_cloud_buffer = reinterpret_cast<const int16_t*>(pointcloud_image.get_buffer());
756752

0 commit comments

Comments
 (0)