#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <opencv2/core/core.hpp>
#include <string>
using namespace std;
int main( )
{
string setting_file("setting.yaml"); // The only lateral
cv::FileStorage fs;
fs.open( setting_file.c_str( ), cv::FileStorage::READ );
pcl::PointCloud< pcl::PointXYZ > cloud;
// Fill in the cloud data
cloud.width = 50;
cloud.height = 1;
cloud.is_dense = false;
cloud.points.resize( cloud.width * cloud.height );
for ( size_t i = 0; i < cloud.points.size( ); ++i )
{
cloud.points[i].x = 1024 * rand( ) / ( RAND_MAX + 1.0f );
cloud.points[i].y = 1024 * rand( ) / ( RAND_MAX + 1.0f );
cloud.points[i].z = 1024 * rand( ) / ( RAND_MAX + 1.0f );
}
string PCDPath = fs["PCDPath"];
pcl::io::savePCDFileASCII( PCDPath, cloud );
return 0;
}
PCL生成.PCD文件
最新推荐文章于 2024-05-28 09:36:34 发布