Set row_step after resizing point cloud

This commit is contained in:
Kotaro Yoshimoto
2026-03-09 08:12:15 +09:00
parent c0c14f538a
commit d8d2a02707
+2
View File
@@ -2774,6 +2774,7 @@ void OBCameraNode::publishDepthPointCloud(const std::shared_ptr<ob::FrameSet> &f
point_cloud_msg->width = valid_count;
point_cloud_msg->height = 1;
modifier.resize(valid_count);
point_cloud_msg->row_step = point_cloud_msg->width * point_cloud_msg->point_step;
}
auto frame_timestamp = getFrameTimestampUs(depth_frame);
auto timestamp = fromUsToROSTime(frame_timestamp);
@@ -2906,6 +2907,7 @@ void OBCameraNode::publishColoredPointCloud(const std::shared_ptr<ob::FrameSet>
point_cloud_msg->width = valid_count;
point_cloud_msg->height = 1;
modifier.resize(valid_count);
point_cloud_msg->row_step = point_cloud_msg->width * point_cloud_msg->point_step;
}
auto frame_timestamp = getFrameTimestampUs(depth_frame);
std::string frame_id = optical_frame_id_[COLOR];