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

Improve the PLY parser to work around some issues on Mac OSX #1165

Merged
merged 3 commits into from
Feb 28, 2015
Merged

Improve the PLY parser to work around some issues on Mac OSX #1165

merged 3 commits into from
Feb 28, 2015

Conversation

jingxue
Copy link
Contributor

@jingxue jingxue commented Feb 28, 2015

I have a couple of PLY files generated by VisualSFM. They keep getting rejected on Mac OSX by pcl_ply2pcd with simply "parsing error" messages. After debugging I found out that it was mostly caused by some intricacies in how streams are handled by some versions of libc++ on Mac OSX. This series of commits works around the issues, at the cost of slightly loosened up parsing validation.

There is (controversially) a bug in some version of libc++ where
attempting to read std::ws at eof would trigger the failbit.

This change removes the std:ws read attempts at statement ends as a
workaround. It obviously loosens up the validation and allows extra
characters towards the end of line, however it would still be better
than rejecting entirely valid PLY files.

A discussion around the original issue can be found here:
http://stackoverflow.com/questions/13423514/should-stdws-raise-failbit-at-end-of-file
Instead of erroring out, it now simply warns that there are extra data
found and ignored beyond the pre-specified number of elements.
@taketwo
Copy link
Member

taketwo commented Feb 28, 2015

Thanks for contributing!

taketwo added a commit that referenced this pull request Feb 28, 2015
Improve the PLY parser to work around some issues on Mac OSX
@taketwo taketwo merged commit 5fbfe0e into PointCloudLibrary:master Feb 28, 2015
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.

2 participants