ROS与VSLAM入门教程-LSD-SLAM安装
ROS与VSLAM入门教程-LSD-SLAM安装
说明:
- 介绍如何安装LSD-SLAM
环境:
- ubuntu14.04 + indigo
步骤:
- 需使用rosbuild构建
sudo apt-get install python-rosinstall
mkdir ~/rosbuild_ws
cd ~/rosbuild_ws
rosws init . /opt/ros/indigo
mkdir package_dir
rosws set ~/rosbuild_ws/package_dir -t .
echo "source ~/rosbuild_ws/setup.bash" >> ~/.bashrc
bash
cd package_dir
- 安装系统依赖:
sudo apt-get install ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev
- 克隆代码库
cd ~/rosbuild_ws
git clone https://github.com/tum-vision/lsd_slam.git lsd_slam
- 安装openFabMap(可选)
- 修改lsd_slam_core/CMakeLists.txt
#add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/openFabMap)
#include_directories(${PROJECT_SOURCE_DIR}/thirdparty/openFabMap/include)
#add_definitions("-DHAVE_FABMAP")
#set(FABMAP_LIB openFABMAP )
- 去掉注释
- 注意openFabMap需要OpenCv nonfree模块支持,OpenCV3.0以上已经不包含,作者推荐2.4.8版本
- nonfree模块安装
$ sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
$ sudo apt-get update
$ sudo apt-get install libopencv-nonfree-dev
- 编译
rosmake lsd_slam
测试:
- 运行roscore
$ roscore
- 启动摄像头
$ rosrun uvc_camera uvc_camera_node device:=/dev/video0
- 启动LSD-viewer查看点云
$ rosrun lsd_slam_viewer viewer
- 启动LSD-core
$ rosrun lsd_slam_core live_slam /image:=image_raw _calib:=<your path>/LSD_room/cameraCalibration.cfg
- 或
$ rosrun lsd_slam_core dataset_slam _files:=<your path>/LSD_room/images _hz:=0 _calib:=<your path>/LSD_room/cameraCalibration.cfg
- _calib校准文件,/image选择视频流
参考:
- https://github.com/tum-vision/lsd_slam
- https://blog.csdn.net/xueyinhualuo/article/details/48490939
- http://vision.in.tum.de/research/vslam/lsdslam?redirect=1
- https://blog.csdn.net/gobitan/article/details/51541977
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号