Ascii Point Cloud Reader.
More...
#include <pcl/io/ascii_io.h>
|
| ASCIIReader () |
|
virtual | ~ASCIIReader () |
|
virtual int | readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, int &data_type, unsigned int &data_idx, const int offset=0) |
| Read a point cloud data header from a FILE file. More...
|
|
virtual int | read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, const int offset=0) |
| Read a point cloud data from a FILE file and store it into a pcl/PCLPointCloud2. More...
|
|
void | setInputFields (const std::vector< pcl::PCLPointField > &fields) |
| Set the ascii file point fields using a list of fields. More...
|
|
template<typename PointT > |
void | setInputFields (const PointT p=PointT()) |
| Set the ascii file point fields using a point type. More...
|
|
void | setSepChars (const std::string &chars) |
| Set the Separting characters for the ascii point fields 2. More...
|
|
void | setExtension (const std::string &ext) |
| Set the extension of the ascii point file type. More...
|
|
| FileReader () |
| empty constructor More...
|
|
virtual | ~FileReader () |
| empty destructor More...
|
|
int | read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset=0) |
| Read a point cloud data from a FILE file (FILE_V6 only!) and store it into a pcl/PCLPointCloud2. More...
|
|
template<typename PointT > |
int | read (const std::string &file_name, pcl::PointCloud< PointT > &cloud, const int offset=0) |
| Read a point cloud data from any FILE file, and convert it to the given template format. More...
|
|
Ascii Point Cloud Reader.
Read any ASCII file by setting the separating characters and input point fields.
- Author
- Adam Stambler (adast.nosp@m.a@gm.nosp@m.ail.c.nosp@m.om)
Definition at line 54 of file ascii_io.h.
pcl::ASCIIReader::ASCIIReader |
( |
| ) |
|
virtual pcl::ASCIIReader::~ASCIIReader |
( |
| ) |
|
|
virtual |
int pcl::ASCIIReader::parse |
( |
const std::string & |
token, |
|
|
const pcl::PCLPointField & |
field, |
|
|
uint8_t * |
data_target |
|
) |
| |
|
protected |
Parses token based on field type.
- Parameters
-
[in] | token | string representation of point fields |
[in] | field | token point field type |
[out] | data_target | address that the point field data should be assigned to returns the size of the parsed point field in bytes |
virtual int pcl::ASCIIReader::read |
( |
const std::string & |
file_name, |
|
|
pcl::PCLPointCloud2 & |
cloud, |
|
|
Eigen::Vector4f & |
origin, |
|
|
Eigen::Quaternionf & |
orientation, |
|
|
int & |
file_version, |
|
|
const int |
offset = 0 |
|
) |
| |
|
virtual |
Read a point cloud data from a FILE file and store it into a pcl/PCLPointCloud2.
- Parameters
-
[in] | file_name | the name of the file containing the actual PointCloud data |
[out] | cloud | the resultant PointCloud message read from disk |
[out] | origin | the sensor acquisition origin (only for > FILE_V7 - null if not present) |
[out] | orientation | the sensor acquisition orientation (only for > FILE_V7 - identity if not present) |
[out] | file_version | the FILE version of the file (either FILE_V6 or FILE_V7) |
[in] | offset | the offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513). |
Implements pcl::FileReader.
virtual int pcl::ASCIIReader::readHeader |
( |
const std::string & |
file_name, |
|
|
pcl::PCLPointCloud2 & |
cloud, |
|
|
Eigen::Vector4f & |
origin, |
|
|
Eigen::Quaternionf & |
orientation, |
|
|
int & |
file_version, |
|
|
int & |
data_type, |
|
|
unsigned int & |
data_idx, |
|
|
const int |
offset = 0 |
|
) |
| |
|
virtual |
Read a point cloud data header from a FILE file.
Load only the meta information (number of points, their types, etc), and not the points themselves, from a given FILE file. Useful for fast evaluation of the underlying data structure.
Returns:
- < 0 (-1) on error
- > 0 on success
- Parameters
-
[in] | file_name | the name of the file to load |
[out] | cloud | the resultant point cloud dataset (only the header will be filled) |
[out] | origin | the sensor acquisition origin (only for > FILE_V7 - null if not present) |
[out] | orientation | the sensor acquisition orientation (only for > FILE_V7 - identity if not present) |
[out] | file_version | the FILE version of the file (either FILE_V6 or FILE_V7) |
[out] | data_type | the type of data (binary data=1, ascii=0, etc) |
[out] | data_idx | the offset of cloud data within the file |
[in] | offset | the offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513). |
Implements pcl::FileReader.
void pcl::ASCIIReader::setExtension |
( |
const std::string & |
ext | ) |
|
|
inline |
Set the extension of the ascii point file type.
- Parameters
-
[in] | ext | extension (example : ".txt" or ".xyz" ) |
Definition at line 130 of file ascii_io.h.
Set the ascii file point fields using a list of fields.
- Parameters
-
[in] | fields | is a list of point fields, in order, in the input ascii file |
template<typename PointT >
void pcl::ASCIIReader::setInputFields |
( |
const PointT |
p = PointT () | ) |
|
void pcl::ASCIIReader::setSepChars |
( |
const std::string & |
chars | ) |
|
Set the Separting characters for the ascii point fields 2.
- Parameters
-
[in] | chars | string of separating characters Sets the separating characters for the point fields. The default separating characters are " \n\t," |
uint32_t pcl::ASCIIReader::typeSize |
( |
int |
type | ) |
|
|
protected |
Returns the size in bytes of a point field type.
- Parameters
-
[in] | type | point field type returns the size of the type in bytes |
Referenced by setInputFields().
std::string pcl::ASCIIReader::extension_ |
|
protected |
std::string pcl::ASCIIReader::name_ |
|
protected |
std::string pcl::ASCIIReader::sep_chars_ |
|
protected |
The documentation for this class was generated from the following file:
- /build/buildd/pcl-1.7-1.7.1/io/include/pcl/io/ascii_io.h