Skip to content

Commit

Permalink
[Debug] fix pcd io small probability bug
Browse files Browse the repository at this point in the history
  • Loading branch information
GCaptainNemo committed Sep 8, 2024
1 parent 4900f66 commit 231bf39
Showing 1 changed file with 11 additions and 7 deletions.
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

0 comments on commit 231bf39

Please sign in to comment.