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

Fixed bug incorrectly copying adjacent points in fromPCLPointCloud2() #1813

Merged
merged 1 commit into from
Feb 9, 2017

Conversation

Chungzuwalla
Copy link

fixes #1802.
fromPCLPointCloud2() tried to copy clouds an entire row at a time, provided the source and destination point types were the same size, even if only part of each point was to be copied. This would incorrectly overwrite all fields of the destination points with irrelevant source data.

Copy link
Member

@jspricke jspricke left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the pull request. I've added a small comment, not sure if it's worth to change or not. +1 otherwise

if (field_map.size() == 1 &&
field_map[0].serialized_offset == 0 &&
field_map[0].struct_offset == 0 &&
msg.point_step == sizeof(PointT))
field_map[0].size == msg.point_step &&
field_map[0].size == sizeof(PointT))
Copy link
Member

Choose a reason for hiding this comment

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

I think it would read easier if we would leave the msg.point_step == sizeof(PointT)). But after all it's the same, right?

Copy link
Author

Choose a reason for hiding this comment

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

I think the comment makes clear that the source msg, destination type and field must all be the same size. Happy to get a consensus from others though.

BTW the Travis checks seem to have failed because compiling the unit tests exceeded the allowed time. Is that normal?

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any difference.
Regarding tests: yes, that's normal :(

@taketwo
Copy link
Member

taketwo commented Feb 9, 2017

Any objections to merging this?

@jspricke jspricke merged commit 6fb1b65 into PointCloudLibrary:master Feb 9, 2017
@taketwo taketwo added this to the pcl-1.8.1 milestone Feb 9, 2017
@Chungzuwalla Chungzuwalla deleted the issue1802 branch February 21, 2017 11:46
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.

Bug in fromPCLPointCloud2()
3 participants