PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.65k stars 4.6k forks source link

[Question] PCLviewer and spinOnce() #5977

Closed jackie-jeong closed 3 months ago

jackie-jeong commented 3 months ago

Describe the bug

I have the same issue of #5237. I've read the previous discussions and found that it seems I need to build the updated PCL from master. In my PC, PCL 1.12.1 was installed together when installing ROS2 but not from the github. Therefore PCL library is in root directory. In this case, may I need to remove the current PCL (libpcl-dev) then install a newer version(PCL-1.14.1) again?

Context

Just a simple visualization of pointclouds using PCLViewer.

Your Environment (please complete the following information):

mvieth commented 3 months ago

Yes, remove libpcl-dev before installing the newer version. You will likely also have to build all ROS packages from source that depend on PCL.

jackie-jeong commented 3 months ago

Thank you for the comment. Since I was a bit worried to update only PCL version while keeping other pcl-dependent libraries in previous versions, I built a new version PCL in local workspace and solved!

A small advice for the people experiencing same error: If you have installed PCL with ROS but don't want to change its version in root directory(PCL 1.12 when it's ROS2 Humble), try to build a new PCL in local workspace. Then do find_package(PCL 1.14 REQUIRED) in CMakelists in the package using PCL.

mvieth commented 3 months ago

Be warned though that it may lead to problems if you have multiple versions of PCL installed. For example if you have a library A that depends on PCL 1.12 (apt installed), and in your own project you depend on library A and PCL 1.14 (compiled from source). The safest approach is to remove PCL 1.12 (apt installed), then compile PCL from source, then compile all PCL-dependent packages from source.