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

[Debug] fix pcd io small probability bug #6122

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions io/src/pcd_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,19 @@ pcl::PCDReader::readHeader (std::istream &fs, pcl::PCLPointCloud2 &cloud,
// Read the header + comments line by line until we get to <DATA>
if (line_type.substr (0, 4) == "DATA")
{
data_idx = static_cast<int> (fs.tellg ());
if (st.at (1).substr (0, 17) == "binary_compressed")
data_type = 2;
else
if (st.at (1).substr (0, 6) == "binary")
data_type = 1;
continue;
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;
break; // DATA is the last header entry, everything after it will be interpreted as point cloud data
}
}
catch (const char *exception)
Expand Down
Loading