Error using "addpointcloud" in pcl
Here is my code to represent point cloud data.
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (new pcl::PointCloud <pcl::PointXYZRGBA>);
if (pcl::io::loadPCDFile ("arg[1]", *cloud) == -1)
return (-1);
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
viewer->setBackgroundColor (0, 0, 0);
viewer->addPointCloud<pcl::PointXYZRGBA> (cloud, "sample cloud");
Does anyone know why I cannot see my cloud cloud data in the output. Although, when I use the code below to display the cloud above the clouds, I can see it in full:
pcl::visualization::CloudViewer viewer1 ("Simple Cloud Viewer");
viewer1.showCloud (cloud);
+3
source to share
1 answer
Have a look: http://pointclouds.org/documentation/tutorials/pcl_visualizer.php#pcl-visualizer Then you can see a piece of code like this function:
boost::shared_ptr<pcl::visualization::PCLVisualizer> rgbVis
Hope this helps you.
0
source to share