源码位置
https://github.com/OctoMap/octomap/blob/devel/octovis/README.md
commit 74c48ae on Apr 26, 2020.
本机系统Ubuntu 18.04,qt5,cmake 3.14.6。
编译
libQGLViewer for octovis
直接cmake configure octomap会报出无法编译libQGLViewer的错误,忽略该错误会导致octovis不能编译,尝试手工编译libQGLViewer。具体报错信息如下
-- QGLViewer includes found in /home/yaoyu/Libraries/octomap/octovis/src/extern/QGLViewer
-- QGLViewer library not found.
-- Trying to build libQGLViewer from source in /home/yaoyu/Libraries/octomap/octovis/src/extern/QGLViewer
-- generating Makefile using qmake
-- building library (this may take some time...)
make: *** No targets specified and no makefile found. Stop.
CMake Warning at octovis/CMakeModules/FindQGLViewer.cmake:111 (MESSAGE):
Could not find libQGLViewer.so, failed to build?
Call Stack (most recent call first):
octovis/CMakeLists.txt:79 (FIND_PACKAGE)
libQGLViewer could not be found or generated.
Unfortunately, the viewer (octovis) can not be built because some requirements are missing.
This will not affect the compilation of the stand-alone library and tools (octomap)
See README.txt or http://octomap.sf.net for further information.
进入octomap/octovis/src/extern/QGLViewer
,执行qmake
和make
。成功生成了libQGLViewer.so
。最后sudo make install
。
OpenGL
cmake configure octomap时还有关于OpenGL的警告,需要用户手工指定OpenGL_GL_PREFERENCE
。
CMake Warning (dev) at /usr/local/share/cmake-3.14/Modules/FindOpenGL.cmake:275 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppres