cd package_dir git clone https://github.com/tum-vision/lsd_slam.git lsd_slam
4.编译
1
rosmake lsd_slam
编译过程中不会一帆风顺,可能出现许多错。我出现的错如下:
error 1
1 2 3 4 5 6 7
# 报错信息 ERROR [gendeps] 1 Finding dependencies for /home/gjh/code/rosbuild_ws/package_dir/lsd_slam/lsd_slam_viewer/cfg/LSDSLAMViewerParams.cfg ...... Exception: quotes not allowed in description string `log10 of threshold on point's variance, in the respective keyframe's scale.
# 解决方法[1] lsd_slam_viewer/src/PointCloudViewer.h中,第135行:将float x, y, z修改为qreal x, y, z lsd_slam_viewer/src/PointCloudViewer.cpp中,第326行:将float x, y, z修改为qreal x, y, z
error 4
1 2 3 4 5 6 7 8
# 报错信息 enum Status ^
# 解决方法[1] 将文件lsd_slam_viewer/src/KeyFrameDisplay.cpp的头文件: # include "opencv2/opencv.hpp" 注释掉
error 5
1 2 3 4 5 6 7 8
# 报错信息 /usr/bin/ld: CMakeFiles/viewer.dir/src/main_viewer.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv' /usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
# 报错信息 /usr/bin/ld: CMakeFiles/live_slam.dir/src/main_live_odometry.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv' /usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status ...... /usr/bin/ld: CMakeFiles/dataset_slam.dir/src/main_on_images.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv' /usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
#选择正确的数据路径 rosbag play ~/LSD_room.bag # playback a bag, usage: rosbag play/record bag
4.理论和代码的学习
相关的有三篇论文 2013 Semi-dense Visual Odometry for a Monocular
Camera 2014 Semi-dense visual odometry for AR on a smartphone 2014
LSD-SLAM: Large-Scale Direct Monocular SLAM