ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Bogdan Harasymowicz-Boggio's profile - activity

2012-09-18 06:16:21 -0500 received badge  Notable Question (source)
2012-09-18 06:16:21 -0500 received badge  Famous Question (source)
2012-07-02 02:54:06 -0500 received badge  Popular Question (source)
2011-12-11 10:28:00 -0500 marked best answer Compatibility of .pcd files in ROS and standalone PCL

Solution posted in question update.

2011-10-14 11:39:30 -0500 received badge  Nice Question (source)
2011-08-31 20:38:07 -0500 received badge  Student (source)
2011-08-29 00:42:48 -0500 asked a question Compatibility of .pcd files in ROS and standalone PCL

Hi,

This is not a question but I don't know where to post it, so please move the topic to the appropriate forum.

For the last few days I've had trouble displaying .pcd files in pcl_visualization pcd_viewer that work properly with the standalone PCL's pcd_viewer and vice-versa (mainly I wanted to process the .pcd files saved generated in RGBDSLAM).

I was unable to find a solution on the Web (just suggestions to install the unstable version of ROS) but now I've found one, so I post it here in case someone has the same problem.

SOLUTION: Create a ros package and add a source file with the following code (the output cloud is XYZ with no color):

#include <pcl/ros/conversions.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>

int
main (int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);

  if (pcl::io::loadPCDFile<pcl::PointXYZ> (argv[1], *cloud) == -1)
  {
    std::cout << "ERROR: couldn't read the pcd file!" << std::endl;
    return (-1);
  }

  pcl::io::savePCDFileASCII ("output_cloud.pcd", *cloud);
  std::cout << "Converted!" << std::endl;

  return (0);
}

rosmake it and execute passing the name of your .pcd file. You'll be able to open correctly the output file either with ROS and standalone PCL.