-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Debug] fix pcd io small probability bug #6122
[Debug] fix pcd io small probability bug #6122
Conversation
f3d609b
to
267d493
Compare
@GCaptainNemo Thanks, this looks like an interesting case. Unfortunately, your current code change makes many tests fail. I have a slightly different suggestion that will hopefully work: Lines 326 to 335 in af7b2d5
To: if (line_type.substr (0, 4) == "DATA")
{
if (st.at (1).substr (0, 17) == "binary_compressed")
data_type = 2;
else if (st.at (1).substr (0, 6) == "binary")
data_type = 1;
else if (st.at (1).substr (0, 5) == "ascii")
data_type = 0;
else {
PCL_WARN("[pcl::PCDReader::readHeader] Unknown DATA format: %s\n", line.c_str());
continue;
}
data_idx = static_cast<int> (fs.tellg ());
break; // DATA is the last header entry, everything after it will be interpreted as point cloud data
} For reference: https://pcl.readthedocs.io/projects/tutorials/en/master/pcd_file_format.html |
267d493
to
231bf39
Compare
@mvieth Thank you for your suggestion! I have changed it to your version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I encountered a bug in parsing the PCD header. The reason is that the first point and first field x (FLOAT32) of my PCD is 13.265933990478516, which corresponds exactly to "DATA" after decoding, causing the code to not decode PCD correctly.
So I submitted this PR, in addition to DATA, the code also needs to use the following string ("binary", "binary_compressed") to determine if it is HEADER.