介绍
ROS octomap wiki: http://wiki.ros.org/octomap
介绍:https://www.cnblogs.com/gaoxiang12/p/5041142.html
高翔git 学习: https://github.com/gaoxiang12/octomap_tutor
安装
ubuntu1604 安装
$ git clone https://github.com/OctoMap/octomap
$ cd octomap/
$ mkdir build && cd build
$ cmake .. && make -j8
$ make install
#测试
$ cd octomap/
$ bin/pcd2octomap data/sample.pcd data/sample.bt
安装ros版本
sudo apt-get install ros-kinetic-octomap ros-kinetic-octomap-mapping ros-kinetic-octomap-msgs ros-kinetic-octomap-ros ros-kinetic-octomap-rviz-plugins ros-kinetic-octomap-server
参考:https://blog.csdn.net/crp997576280/article/details/74605766
问题定位与解决
运行时出现错误libQGLViewer.so.2: cannot open shared object file: No such file or directory
#出现错误
octovis: error while loading shared libraries: libQGLViewer.so.2: cannot open shared object file: No such file or directory
#解决方案:
$sudo find / -name "*libQGLViewer.so*" #寻找本机上是否有这个库,如果下载了octomap一般会有,如果没有,重新下载安装octomap
$echo $LD_LIBRARY_PATH #查看库目录路径是否包含上面的库目录
/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/usr/local/lib
$ ls /usr/local/lib #
$ sudo cp ~/Downloads/octomap/octovis/src/extern/QGLViewer/libQGLViewer.so* /usr/local/lib
#重新打开一个terminal 进行编译
该类问题解决方案参考:https://blog.csdn.net/superbfly/article/details/38983123