ubuntu16 编译LSD—SLAM所遇到的那些坑

安装过程参见:

https://github.com/YaoZhiwen/lsd_slam_catkin_16.04
We tested LSD-SLAM using Ubuntu 16.04 and ROS kinetic.

2.1 ROS kinetic + Ubuntu 16.04
Install system dependencies:

sudo apt-get install ros-kinetic-libg2o ros-kinetic-cv-bridge liblapack-dev libblas-dev freeglut3-dev libsuitesparse-dev libx11-dev

sudo apt install libqglviewer-dev-qt4
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libQGLViewer-qt4.so libQGLViewer.so
In your catkin_ws/src package path, clone the repository:

git clone https://github.com/YaoZhiwen/lsd_slam_catkin_16.04.git lsd_slam
Compile the two package by typing:

catkin_make

这个是在ubuntu16.04上的改进版本,编译过程中出错较少。

编译中遇到的问题:
1、

In file included from /home/xxx/lsd-slam_ws/src/lsd_slam/lsd_slam_viewer/src/main_viewer.cpp:25:0:
/home/xxx/lsd-slam_ws/src/lsd_slam/lsd_slam_viewer/src/PointCloudViewer.h:30:41: fatal error: lsd_slam_viewer/keyframeMsg.h: No such file or directory
#include "lsd_slam_viewer/keyframeMsg.h"

解决方案:

缺少X11库的连接,在lsd-slam-viewer文件夹下面的CMakelists.txt中,在

target_link_libraries(viewer ${
     QGLViewer_LIBRARIES}
			     ${
     QGLVIEWER_LIBRARY} 
			     ${
     catkin_LIBRARIES}
			     ${
     Boost_LIBRARIES}
			     ${
     QT_LIBRARIES}
			     GL glut GLU ~~X11~~ 
		     )

加上X11库即可。

2、

/opt/ros/kinetic/lib/libopencv_core3.so.3.3.1', needed by /home/xxx/.... 

原因:
ros-kinetic版本的libopencv_core3.so.3.3.1不在/opt/ros/kinetic/lib/下,而是在/opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3.1下面,所以在lsd-slam-core文件夹下面的CMakelists.txt中,的set(OpenCV_LIBS)更改为

set(OpenCV_LIBS /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_core3.so.3.3.1 /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_imgproc3.so.3.3.1 /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_highgui3.so.3.3.1 /opt/ros/kinetic/lib/x86_64-linux-gnu/libopencv_calib3d3.so.3.3.1)

即可。

3、最后完成进行数据集进行测试的时候,出现错误

double free or corruption(out)

并且在编译过程中出现了大量的Eigen警告,无法进行数据集的使用。

解决方案:

将Eigen的版本改为3.2.5即可解决,先将Ubuntu系统上的eigen删除,再去下载3.2.5版本,重新进行编译即可解决。

你可能感兴趣的:(ubuntu16 编译LSD—SLAM所遇到的那些坑)