PCL-Cpp (70%)

PCL-Cpp์—์„œ๋Š” ์ ๊ตฐ ์ž…์ถœ๋ ฅ์„ ์œ„ํ•ด์„œ ํ…œํ”Œ๋ฆฟ ํด๋ž˜์Šค๋‚˜ ๊ตฌ์กฐ์ฒด๋ฅผ ํ™œ์šฉ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ [์ด๊ณณ]์„ ์ฐธ๊ณ  ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

// template
pcl::PointCloud<pcl::PointXYZ>

// struct 
Pcl::PointXYZ
Pcl::PointXYZI
Pcl::PointXYZRGB
Pcl::PCLPointCloud2

1. ์ฝ๊ธฐ

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

int
main (int argc, char** argv)
{

  //READ #1 
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
  pcl::io::loadPCDFile<pcl::PointXYZ> ("tabletop.pcd", *cloud); //๋‚ด๋ถ€์ ์œผ๋กœ reader.read() ํ˜ธ์ถœ 

  //READ #2
  //pcl::PointCloud<pcl::PointXYZ> cloud;
  //pcl::io::loadPCDFile<pcl::PointXYZ>("tabletop.pcd", cloud) //๋‚ด๋ถ€์ ์œผ๋กœ reader.read() ํ˜ธ์ถœ 

  //READ #3
  //pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
  //pcl::PCDReader reader;
  //reader.read<pcl::PointXYZ>("tabletop.pcd", cloud);


  std::cout << "Loaded " << cloud->width * cloud->height  << std::endl; //cloud_filtered->points.size()

  return (0);
}

์‹œ๊ฐํ™” ํ™•์ธ

2. ์ƒ์„ฑ & ์“ฐ๊ธฐ

Last updated

Was this helpful?