使用 pcl-tools 1.12.1 显示点云后出现 segmentation fault

使用 libpcl-dev-1.12.1 显示点云后显示一大串关于 vtk 的警告且最后出现 sgmentation fault
1 | 2024-03-27 07:06:36.626 ( 1.903s) [ 1B11AC80]vtkOpenGLPolyDataMapper:328 WARN| vtkOpenGLPolyDataMapper::SetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version. Use vtkOpenGLShaderProperty::SetGeometryShaderCode instead. |
similar issue: https://github.com/PointCloudLibrary/pcl/issues/5237
解决办法
卸载 pcl-1.12,使用 1.13 版本,但这个版本我 (Ubuntu 22.04.4) 无法通过 apt 安装,只能通过源代码编译安装。
卸载 pcl-1.12.1
1 | # 确认版本 |
1 | sudo apt remove libpcl-dev pcl-tools |
在 github 上下载 pcl 源代码
1 | git clone https://github.com/PointCloudLibrary/pcl.git |
按照文档编译安装 pcl-1.13.1
https://pcl.readthedocs.io/projects/tutorials/en/latest/compiling_pcl_posix.html
1 | mkdir build && cd build |
安装 vtk
1 | apt install vtk9 libvtk9-dev |
测试是否可用
