Public Member Functions

pcl::PCDWriter Class Reference
[Module io]

Point Cloud Data (PCD) file format writer. More...

#include <pcl/io/pcd_io.h>

List of all members.

Public Member Functions

std::string generateHeaderBinary (const sensor_msgs::PointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation)
 Generate the header of a PCD v.7 file format.
std::string generateHeaderASCII (const sensor_msgs::PointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation)
 Generate the header of a PCD v.7 file format.
int writeASCII (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), int precision=7)
 Save point cloud data to a PCD file containing n-D points, in ASCII format.
int writeBinary (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity())
 Save point cloud data to a PCD file containing n-D points, in BINARY format.
int write (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), bool binary=false)
 Save point cloud data to a PCD file containing n-D points.
int write (const std::string &file_name, const sensor_msgs::PointCloud2::ConstPtr &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), bool binary=false)
 Save point cloud data to a PCD file containing n-D points.
template<typename PointT >
int write (const std::string &file_name, const pcl::PointCloud< PointT > &cloud, bool binary=false)
 Save point cloud data to a PCD file containing n-D points.
template<typename Type >
void copyValueString (const sensor_msgs::PointCloud2 &cloud, unsigned int point_index, int point_size, unsigned int field_idx, unsigned int fields_count, std::ostream &stream)
 insers a value of type Type (uchar, char, uint, int, float, double, ...) into a stringstream

Detailed Description

Point Cloud Data (PCD) file format writer.

Author:
Radu Bogdan Rusu

Definition at line 242 of file pcd_io.h.


Member Function Documentation

template<typename Type >
void pcl::PCDWriter::copyValueString ( const sensor_msgs::PointCloud2 cloud,
unsigned int  point_index,
int  point_size,
unsigned int  field_idx,
unsigned int  fields_count,
std::ostream &  stream 
) [inline]

insers a value of type Type (uchar, char, uint, int, float, double, ...) into a stringstream

if the value is NaN, it inserst "nan".

Parameters:
cloud the cloud to copy from
point_index the index of the point
point_size the size of the point in the cloud
field_idx the index of the dimension/field
fields_count the current fields count
stream the ostringstream to copy into

Definition at line 387 of file pcd_io.h.

std::string pcl::PCDWriter::generateHeaderASCII ( const sensor_msgs::PointCloud2 cloud,
const Eigen::Vector4f &  origin,
const Eigen::Quaternionf &  orientation 
)

Generate the header of a PCD v.7 file format.

Parameters:
cloud the point cloud data message
origin the sensor acquisition origin
orientation the sensor acquisition orientation
std::string pcl::PCDWriter::generateHeaderBinary ( const sensor_msgs::PointCloud2 cloud,
const Eigen::Vector4f &  origin,
const Eigen::Quaternionf &  orientation 
)

Generate the header of a PCD v.7 file format.

Parameters:
cloud the point cloud data message
origin the sensor acquisition origin
orientation the sensor acquisition orientation
template<typename PointT >
int pcl::PCDWriter::write ( const std::string &  file_name,
const pcl::PointCloud< PointT > &  cloud,
bool  binary = false 
) [inline]

Save point cloud data to a PCD file containing n-D points.

Parameters:
file_name the output file name
cloud the pcl::PointCloud data
binary set to true if the file is to be written in a binary PCD format, false (default) for ASCII

Caution: PointCloud structures containing an RGB field have traditionally used packed float values to store RGB data. Storing a float as ASCII can introduce variations to the smallest bits, and thus significantly alter the data. This is a known issue, and the fix involves switching RGB data to be stored as a packed integer in future versions of PCL.

Definition at line 360 of file pcd_io.h.

int pcl::PCDWriter::write ( const std::string &  file_name,
const sensor_msgs::PointCloud2 cloud,
const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero (),
const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity (),
bool  binary = false 
) [inline]

Save point cloud data to a PCD file containing n-D points.

Parameters:
file_name the output file name
cloud the point cloud data message
origin the sensor acquisition origin
orientation the sensor acquisition orientation
binary set to true if the file is to be written in a binary PCD format, false (default) for ASCII

Caution: PointCloud structures containing an RGB field have traditionally used packed float values to store RGB data. Storing a float as ASCII can introduce variations to the smallest bits, and thus significantly alter the data. This is a known issue, and the fix involves switching RGB data to be stored as a packed integer in future versions of PCL.

Definition at line 311 of file pcd_io.h.

int pcl::PCDWriter::write ( const std::string &  file_name,
const sensor_msgs::PointCloud2::ConstPtr cloud,
const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero (),
const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity (),
bool  binary = false 
) [inline]

Save point cloud data to a PCD file containing n-D points.

Parameters:
file_name the output file name
cloud the point cloud data message (boost shared pointer)
binary set to true if the file is to be written in a binary PCD format, false (default) for ASCII
origin the sensor acquisition origin
orientation the sensor acquisition orientation

Caution: PointCloud structures containing an RGB field have traditionally used packed float values to store RGB data. Storing a float as ASCII can introduce variations to the smallest bits, and thus significantly alter the data. This is a known issue, and the fix involves switching RGB data to be stored as a packed integer in future versions of PCL.

Definition at line 338 of file pcd_io.h.

int pcl::PCDWriter::writeASCII ( const std::string &  file_name,
const sensor_msgs::PointCloud2 cloud,
const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero(),
const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity(),
int  precision = 7 
)

Save point cloud data to a PCD file containing n-D points, in ASCII format.

Parameters:
file_name the output file name
cloud the point cloud data message
origin the sensor acquisition origin
orientation the sensor acquisition orientation
precision the specified output numeric stream precision (default: 7)

Caution: PointCloud structures containing an RGB field have traditionally used packed float values to store RGB data. Storing a float as ASCII can introduce variations to the smallest bits, and thus significantly alter the data. This is a known issue, and the fix involves switching RGB data to be stored as a packed integer in future versions of PCL.

int pcl::PCDWriter::writeBinary ( const std::string &  file_name,
const sensor_msgs::PointCloud2 cloud,
const Eigen::Vector4f &  origin = Eigen::Vector4f::Zero(),
const Eigen::Quaternionf &  orientation = Eigen::Quaternionf::Identity() 
)

Save point cloud data to a PCD file containing n-D points, in BINARY format.

Parameters:
file_name the output file name
cloud the point cloud data message
origin the sensor acquisition origin
orientation the sensor acquisition orientation

The documentation for this class was generated from the following file: