Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Trying to view a .pcd file through the cloud_view in ROS

I am trying to read a .pcd file and view it in the cloud viewer as follows:

int main (int argc, char** argv) { ///code for reading the pcd file////
pcl::PointCloud<pcl::pointxyzrgb>::Ptr cloud (new pcl::PointCloud<pcl::pointxyzrgb>);

if (pcl::io::loadPCDFile<pcl::pointxyzrgb> ("group12_2.pcd", cloud) == -1) // load the file { std::cout<< "Couldn't read file test_pcd.pcd \n"; return (-1); } pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer"); viewer.showCloud (cloud); while (!viewer.wasStopped ()) { }

return (0); }

I got an error that the header file pcl/visualization/cloud_viewer.h was not found. So I searched and installed the missing perception_pcl_addon dependency into the ros stack and added the dependency into the manifest of the package. There is error that the dependency cannot be found when actually it is there. I tried creating a new package with ros-create and specifying the dependency there as well, I get the same error.

My package-path and other variables are set and I can make and compile other codes.

Please let me know Thank you

Trying to view a .pcd file through the cloud_view in ROS

I am trying to read a .pcd file and view it in the cloud viewer as follows:

int main (int argc, char** argv) { ///code for reading the pcd file////
pcl::PointCloud<pcl::pointxyzrgb>::Ptr cloud (new pcl::PointCloud<pcl::pointxyzrgb>);

if (pcl::io::loadPCDFile<pcl::pointxyzrgb> ("group12_2.pcd", cloud) == -1) // load the file { std::cout<< "Couldn't read file test_pcd.pcd \n"; return (-1); } pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer"); viewer.showCloud (cloud); while (!viewer.wasStopped ()) { }

return (0); }

I got an error that the header file pcl/visualization/cloud_viewer.h was not found. So I searched and installed the missing perception_pcl_addon dependency into the ros stack and added the dependency into the manifest of the package. There is error that the dependency cannot be found when actually it is there. I tried creating a new package with ros-create and specifying the dependency there as well, I get the same error.

My package-path and other variables are set and I can make and compile other codes.

Please let me know Thank you