ros-perception / perception_pcl

PCL (Point Cloud Library) ROS interface stack
http://wiki.ros.org/perception_pcl
426 stars 335 forks source link

Captured .pcd files do not contain the same data as original pointcloud #129

Open dbolkensteyn opened 7 years ago

dbolkensteyn commented 7 years ago

I'm probably doing something wrong, but I can't figure out what it is.

I am using an Intel RealSense R200 to capture a pointcloud. It publishes RGBD data on the topic /camera/depth_registered/points. Using rosbag record -l 1 /camera/depth_registered/points and rosbag play original.bag I can replay the captured pointcloud back even after the camera is disconnected. The replayed data is the same as the original data captured by the camera, as expected of course.

Now, if I convert this bag file to a pcd one using rosrun pcl_ros bag_to_pcd and replay it with rosrun pcl_ros pcd_to_pointcloud, it all still works as expected.

The issue arises when I try to generate the pcd directly from the pointcloud. If I run rosrun pcl_ros pointcloud_to_pcd input:=/camera/depth_registered/points and rosbag play original.bag, the generated pcd file will this time contain a lot of red pixels, which were not in the original data. I have also tried to reimplement pointcloud_to_pcd myself by programmatically subscribing to the topic and calling PCDWriter.writeASCII() or pcl::io::savePCDFileASCII() but I also always end up with the red pixels no matter what I try.

I am using ROS Kinetic on Ubuntu 16.04 (4.4.0-66-generic). pcl_conversions is at version 0.2.1, pcl_msgs at 0.2.0 and pcl_ros at 1.4.1.

The rosbag with the original pointcloud is available here: original.bag.zip

Here is an image of the original PCD (generated using pcl_pcd2png on the output of bag_to_pcd): original

and here is the corrupted PCD (generated using pcl_pcd2png on the output of pointcloud_to_pcd): corrupted

AndyZe commented 7 years ago

Random comment, but recording depth_registered/points is probably not the most efficient way. http://wiki.ros.org/openni_launch/Tutorials/BagRecordingPlayback