Ubuntu下安装LSD-SLAM
安装
官方编译方法1
1 | sudo apt-get install python-rosinstall |
以上是官方的方法,但是我出现了编译错误:
1 | opt/ros/indigo/include/sophus/sim3.hpp:339:5: error: passing ‘const RxSO3Type {aka const Sophus::RxSO3Group}’ as ‘this’ argument of ‘void Sophus::RxSO3GroupBase::setScale(const Scalar&) [with Derived = Sophus::RxSO3Group; Sophus::RxSO3GroupBase::Scalar = double]’ discards qualifiers [-fpermissive] |
于是尝试使用Ros的catkin对LSD-SLAM进行编译
使用catkin对LSD-SLAM进行编译23
1 | mkdir -p ~/catkin_ws/src |
change to the Catkin "branch" of the LSD-SLAM project, then:
1 | sudo apt-get install ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev |
对lsd_slam/lsd_slam_viewer
和lsd_slam/lsd_slam_core
文件夹下的package.xml
中添加:
1 | <build_depend>cmake_modules</build_depend> |
对lsd_slam/lsd_slam_viewer
和lsd_slam/lsd_slam_core
文件夹下的CMakeFiles.txt
中添加:
1 | find_package(cmake_modules REQUIRED) |
并且在所有的target_link_libraries
中添加X11
,如:
1 | target_link_libraries(lsdslam ${FABMAP_LIB} ${G2O_LIBRARIES} ${catkin_LIBRARIES} sparse cxsparse X11) |
然后开始编译:
1 | cd ~/catkin_ws/ |
运行离线测试程序4
Download the Room Example Sequence and extract it.
打开一个终端:
1 | roscoe |
打开另外一个终端:
1 | cd ~/catkin_ws/ |
打开另外一个终端:
1 | cd ~/catkin_ws/ |
打开另外一个终端:
1 | cd ~/catkin_ws/ |
使用摄像头运行LSD_SLAM
安装驱动5:
1 | cd ~/catkin_ws/ |
会显示一些摄像头的信息,如:
1 | opening /dev/video1 |
配置camera_node.launch文件6,如:
1 | <launch> |
注意官方程序默认分辨率为640*480。
打开一个窗口运行roscore
; 打开另外一个窗口:
1 | cd ~/catkin_ws/ |
再打开另外一个窗口:
1 | cd ~/catkin_ws/ |
再打开另外一个窗口:
1 | rosrun lsd_slam_core live_slam /image:=image_raw _calib:=<calibration_file> |
校正文件calibration_file可参考lsd_catkin_ws/src/lsd_slam/lsd_slam_core/calib
中的cfg文件。
https://github.com/tum-vision/lsd_slam↩︎
http://visbot.blogspot.jp/2014/11/tutorial-building-of-lsd-slam-on-ros.html↩︎
https://github.com/tum-vision/lsd_slam/issues/206↩︎
http://visbot.blogspot.jp/2014/11/tutorial-building-of-lsd-slam-on-ros.html↩︎
https://defendtheplanet.net/2014/11/05/using-ros-indigo-webcam-by-the-uvc_camera-usb-video-class-package↩︎
http://www.cnblogs.com/xtl9/p/4694881.html↩︎