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

fix in toPCLPointCloud2 if input cloud has no points #1723

Merged

Conversation

magro11
Copy link

@magro11 magro11 commented Sep 20, 2016

Fixes #1716

Copy link
Contributor

@stefanbuettner stefanbuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion the other data fields should be copied nevertheless. Your change doesn't change that, so looks good.

@@ -254,7 +254,10 @@ namespace pcl
// Fill point cloud binary data (padding and all)
size_t data_size = sizeof (PointT) * cloud.points.size ();
msg.data.resize (data_size);
memcpy (&msg.data[0], &cloud.points[0], data_size);
if (data_size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd write data_size > 0 to be clear what's happening although it's equivalent since it's of type size_t.

@SergioRAgostinho SergioRAgostinho added this to the pcl-1.8.1 milestone Oct 24, 2016
@SergioRAgostinho SergioRAgostinho merged commit 490c4c6 into PointCloudLibrary:master Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants