基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/gobitan/article/details/51541977

基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功

作者:雨水/家辉  日期:2016-05-30  CSDN博客:http://blog.csdn.net/gobitan

摘要:LSD-SLAM是一个实时的单目SLAM. 它能实时地在电脑上直接(不使用关键点和特征)创建大规模的半稠密地图,甚至可以运行在智能手机上,如Android/iOS.

 

第一步:搭建Ubuntu14.04.4+ROS indigo基础环境

[1] 在http://releases.ubuntu.com/14.04/官网下载ubuntu-14.04.4-desktop-i386.iso安装包,大约1G。然后在VMware Player里安装好,可以采用VMPlayer的Easy Install自动化安装整个过程不需要干预。

备注:因为ROS包含rviz可视化环境,因此需要选择桌面版。

 

[2] 将安装源换成阿里云的,如何换请参考http://mirrors.aliyun.com/help/ubuntu;

备注:强烈建议将安装源换成国内的,否则安装的时候要么速度慢,要么可能连不上。

 

[3] 在Ubuntu14.04.4中安装ROS indigo,参考:http://wiki.ros.org/indigo/Installation/Ubuntu

dennis@ubuntu:~$ sudo apt-get update

dennis@ubuntu:~$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

dennis@ubuntu:~$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116

dennis@ubuntu:~$ sudo apt-get update

dennis@ubuntu:~$ sudo apt-get install ros-indigo-desktop-full

备注:这里采用的完整安装模式.

 

dennis@ubuntu:~$ sudo rosdep init

dennis@ubuntu:~$ rosdep update

 

dennis@ubuntu:~$ echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc

dennis@ubuntu:~$ source ~/.bashrc

 

[4] 校验安装是否成功,输入roscore命令,如下:

dennis@ubuntu:~$ roscore

... logging to /home/dennis/.ros/log/9f2ace00-16b9-11e6-a10c-000c29b0df82/roslaunch-ubuntu-2078.log

Checking log directory for disk usage. This may take awhile.

Press Ctrl-C to interrupt

Done checking log file disk usage. Usage is <1GB.

 

started roslaunch server http://ubuntu:44364/

ros_comm version 1.11.19

 

SUMMARY

========

 

PARAMETERS

 * /rosdistro: indigo

 * /rosversion: 1.11.19

 

NODES

 

auto-starting new master

process[master]: started with pid [2090]

ROS_MASTER_URI=http://ubuntu:11311/

 

setting /run_id to 9f2ace00-16b9-11e6-a10c-000c29b0df82

process[rosout-1]: started with pid [2103]

started core service [/rosout]

[5] 安装ROS工具

dennis@ubuntu:~$ sudo apt-get install python-rosinstall

 

第二步:初始化ros编译环境及编译lsd_slam

dennis@ubuntu:~$ mkdir ~/rosbuild_ws

dennis@ubuntu:~$ cd ~/rosbuild_ws/

dennis@ubuntu:~/rosbuild_ws$ rosws init . /opt/ros/indigo

dennis@ubuntu:~/rosbuild_ws$ mkdir package_dir

dennis@ubuntu:~/rosbuild_ws$ rosws set ~/rosbuild_ws/package_dir -t .

dennis@ubuntu:~/rosbuild_ws$ echo "source ~/rosbuild_ws/setup.bash" >> ~/.bashrc

dennis@ubuntu:~/rosbuild_ws$ bash

dennis@ubuntu:~/rosbuild_ws$ cd package_dir/

dennis@ubuntu:~/rosbuild_ws/package_dir$

dennis@ubuntu:~/rosbuild_ws/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

dennis@ubuntu:~/rosbuild_ws/package_dir$ git clone https://github.com/tum-vision/lsd_slam.git lsd_slam

dennis@ubuntu:~/rosbuild_ws/package_dir$ ls -lrt

total 4

drwxrwxr-x 5 dennis dennis 4096 May  8 03:30 lsd_slam

dennis@ubuntu:~/rosbuild_ws/package_dir$ rosmake lsd_slam

 

第三步:采用官方提供的数据集进行测试

备注:数据集下载请参考本文的参考资料[2].

测试方法一(采用image):

dennis@ubuntu:~$ roscore

dennis@ubuntu:~$ rosrun lsd_slam_viewer viewer

dennis@ubuntu:~$ rosrun lsd_slam_core dataset_slam _files:=/home/dennis/LSD_room/images _hz:=0 _calib:=/home/dennis/LSD_room/cameraCalibration.cfg

 

测试方法二(采用bag文件):

dennis@ubuntu:~$ roscore

dennis@ubuntu:~$ rosrun lsd_slam_viewer viewer

dennis@ubuntu:~$ rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

dennis@ubuntu:~$ rosbag play LSD_room.bag

 

后记

这里只是做了简单的测试,获取直接的感官认识,后续将仔细阅读论文,阅读源代码,深入理解其实现原理及过程.

 

参考资料:

[1] https://github.com/tum-vision/lsd_slam   LSD_SLAM官网 

[2] http://vision.in.tum.de/research/vslam/lsdslam 德国慕尼黑工业大学(TUM)计算机视觉组

[3] http://wiki.ros.org/indigo/Installation/Ubuntu  在Ubuntu14.04.4上安装ROS Indigo

[4] http://releases.ubuntu.com/14.04/   官网下载ubuntu-14.04.4-desktop-i386.iso 

[5] http://wiki.ros.org/ROS/Tutorials 用于ROS安装成功之后的测试

[6] http://www.dev47apps.com/droidcam/linuxx/  将手机摄像头的视频传输到电脑上的工具

阅读更多

没有更多推荐了,返回首页