测试ros自带的PCL1.8是否能用,网上找个测试代码,编译阶段报错:
cmake ..
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.** WARNING ** io features related to libusb-1.0 will be disabled
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** visualization features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** visualization features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** visualization features related to dssdk will be disabled
-- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES)
** WARNING ** visualization features related to rssdk will be disabled
-- looking for PCL_COMMON
make
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libGL.so', needed by 'pcl_test'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pcl_test.dir/all' failed
make[1]: *** [CMakeFiles/pcl_test.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
报错:
-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.
解决方法[参考]:
sudo ln -s /usr/bin/vtk6 /usr/bin/vtk
尝试1:
cmake 提示与vtk有关的错误, 于是尝试重装vtk[参考]:
sudo apt-get remove libvtk7
sudo apt-get remove libvtk6** //vtk6*
结果,被告知ros和pcl也要跟随者vtk一起被卸载(安装ros时会自带pcl1.8和vtk6.1):
The following packages will be REMOVED:
libopencv-contrib-dev libopencv-contrib3.2 libopencv-dev libopencv-viz-dev
libopencv-viz3.2 libopencv3.2-java libopencv3.2-jni libpcl-apps1.8
libpcl-dev libpcl-io1.8 libpcl-recognition1.8 libpcl-surface1.8
libpcl-visualization1.8 libvtk6-dev libvtk6-java libvtk6-jni libvtk6-qt-dev
libvtk6.3 libvtk6.3-qt pcl-tools python-opencv python-vtk6 python3-opencv
ros-melodic-camera-calibration ros-melodic-compressed-depth-image-transport
ros-melodic-compressed-image-transport ros-melodic-cv-bridge
ros-melodic-depth-image-proc ros-melodic-desktop ros-melodic-desktop-full
ros-melodic-gazebo-plugins ros-melodic-gazebo-ros-pkgs
ros-melodic-image-geometry ros-melodic-image-pipeline ros-melodic-image-proc
ros-melodic-image-publisher ros-melodic-image-rotate
ros-melodic-image-transport-plugins ros-melodic-image-view
ros-melodic-pcl-conversions ros-melodic-pcl-ros ros-melodic-perception
ros-melodic-perception-pcl ros-melodic-rqt-common-plugins
ros-melodic-rqt-image-view ros-melodic-simulators
ros-melodic-stereo-image-proc ros-melodic-theora-image-transport
ros-melodic-vision-opencv ros-melodic-viz tcl-vtk6 vtk6
0 upgraded, 0 newly installed, 52 to remove and 20 not upgraded.
After this operation, 331 MB disk space will be freed.
Do you want to continue? [Y/n] n
果断选择n,因为ros卸载后,之前配置的环境白配置了。
尝试2:
通过 [vtk官网]查看vtk如何卸载,在官网的资源-入门找到[vtk使用手册],发现vtk要求OpenGL版本最低为3.2
查看自己的OpenGL版本:
glxinfo | grep 'OpenGL version'
版本为:3.1