AaronMR / Learning_ROS_for_Robotics_Programming_2nd_edition

Code and examples for Learning ROS for Robotics Programming - 2nd Edition
450 stars 307 forks source link

Error when using pcl_visualize2.cpp #13

Closed klajdo-f closed 8 years ago

klajdo-f commented 8 years ago

I am trying to run pcl_visualize2.cpp from chapter6_tutorials. I built with catkin_make and the run with rosrun but, after I get the below messages:

[addPointCloud] A PointCloud with id <output> already exists! Please choose a different id and retry.

and it doesn’t show anything.

I have to mentioned that I am new in PCL but, however every other tutorial runs fine.

Thanks in advance

efernandez commented 8 years ago

@Anilm3 @LuisSC any idea?

Anilm3 commented 8 years ago

@klajdi123 Which version of ROS are you using? Have you done any changes to the code?

The following code in the pcl_visualize2 node should prevent this from happening.

viewer.removeAllPointClouds(output_view);
viewer.addPointCloud<pcl::PointXYZ>(cloud.makeShared(), "output", output_view);

Since I can't seem to reproduce the issue, could you let me know which version of ROS and PCL you're using?

Finally, could you verify if changing it those two lines to the following has any effect?

viewer.removePointCloud("output", output_view);
viewer.addPointCloud<pcl::PointXYZ>(cloud.makeShared(), "output", output_view);
klajdo-f commented 8 years ago

@Anilm3 Thanks for your reply, and I am really sorry about the late answer. I run ROS indigo, and I made it without changing anything. I think the fault was the version of the PCL. I am really sorry again but, I am a beginner.