LSD-SLAM在Ubuntu14.04+indigo环境中编译运行
来源:互联网 发布:刀具寿命如何编程 编辑:程序博客网 时间:2024/06/14 19:51
LSD-SLAM在Ubuntu14.04+indigo环境中编译运行
LSD-SLAM源码:https://github.com/tum-vision/lsd_slam
LSD-SLAM官网:https://vision.in.tum.de/research/vslam/lsdslam
1、初始化ROS工作空间
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
2、安装依赖项:
sudo apt-get install ros-indigo-libg2o ros-indigo-cv-bridge liblapack-dev libblas-dev freeglut3-dev libqglviewer-dev libsuitesparse-dev libx11-dev
3、在package_dir目录下克隆lsd_slam源码
git clone https://github.com/tum-vision/lsd_slam.git lsd_slam
4、编译lsd_slam包
rosmake lsd_slam
5、下载Datasets
https://vision.in.tum.de/research/vslam/lsdslam
官网提供了Datasets,可以下载
下载video:后面的.bag文件或者.png文件都可以。
6、运行测试lsd_slam,下面提供三种测试方式
1)使用.bag数据集
将第5步下载的.bag文件解压。
例如我解压后得到了 LSD_room.bag文件,该文件831.7MB。
在新终端运行roscore
roscore
在新终端运行 lsd_slam viewer
rosrun lsd_slam_viewer viewer
在新终端运行lsd_slam main ros node
rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info
在新终端运行.bag文件
rosbag play ~/LSD_room.bag
2)使用.png数据集
第5步下载.png得到的压缩包解压后得到LSD_room文件夹,里面包含images文件夹和cameraCalibration.cfg文件。
在新终端运行roscore
roscore
在新终端运行 lsd_slam viewer
rosrun lsd_slam_viewer viewer
在新终端运行lsd_slam main ros node
rosrun lsd_slam_core dataset_slam _files:=/home/username/LSD_room/images _hz:=0 _calib:=/home/username/LSD_room/cameraCalibration.cfg
注:这儿的路径应与你的数据集路径一致
3)使用USB摄像头实时采集视频
安装uvc_camera
mkdir catkin_ws
cd catkin_ws
mkdir src
cd src
git clone https://github.com/ros-drivers/libuvc_ros.git
cd ..
catkin_make
编译完成后,若是使用笔记本电脑,因为其自带摄像头编号为/dev/video0,因此需修改uvc_camera.launch文件,将/dev/video0改为/dev/video1
gedit src/camera_umd/uvc_camera/launch/camera_node.launch
当然还可以在里面修改摄像头的分辨率,我将分辨率改为了640*480。
设置好后,我们可以运行检查驱动是否安装成功
先source一下uvc_camera的setup.bash文件,然后
roslaunch uvc_camera camera_node.launch
rosrun image_view image_view image:=/image_raw
此时出现视频窗口说明驱动安装成功。
下面使用USB摄像头进行lsd_slam
roscore
在新终端运行 lsd_slam viewer
rosrun lsd_slam_viewer viewer
在新终端运行uvc_camera.launch
roslaunch uvc_camera camera_node.launch
在新终端运行lsd_slam main ros node
rosrun lsd_slam_core live_slam /image:=<yourstreamtopic> _calib:=<calibration_file>
我的命令行为:rosrun lsd_slam_core live_slam /image:=image_raw _calib:= ~/rosbuild_ws/package_dir/lsd_slam/lsd_slam_core/calib/OpenCV_example_calib.cfg
此处<yourstreamtopic> 为USB摄像头发布的话题,可执行rostopic list查看,为image_raw
<calibration_file>为摄像机标定文件,规则参考如下:
Camera Calibration:
LSD-SLAM operates on a pinhole camera model, however we give the option to undistort images before they are being used. You can find some sample calib files in lsd_slam_core/calib.
Calibration File for FOV camera model:
fx/width fy/height cx/width cy/height d
in_width in_height
"crop" / "full" / "none" / "e1 e2 e3 e4 0"
out_width out_height
Here, the values in the first line are the camera intrinsics and radial distortion parameter as given by the PTAM cameracalibrator, in_width and in_height is the input image size, and out_width out_height is the desired undistorted image size. The latter can be chosen freely, however 640x480 is recommended as explained in section 3.1.6. The third line specifies how the image is distorted, either by specifying a desired camera matrix in the same format as the first four intrinsic parameters, or by specifying "crop", which crops the image to maximal size while including only valid image pixels.
Calibration File for Pre-Rectified Images
This one is without radial distortion correction, as a special case of ATAN camera model but without the computational cost:
fx/width fy/height cx/width cy/height 0
width height
none
width height
Calibration File for OpenCV camera model:
fx fy cx cy k1 k2 p1 p2
inputWidth inputHeight
"crop" / "full" / "none" / "e1 e2 e3 e4 0"
outputWidth outputHeight
注:若出现[rospack]Error:package’***’not found,请source你的setup.bash
参考网站:
http://blog.csdn.net/gobitan/article/details/51541977
http://www.mamicode.com/info-detail-957983.html
https://vision.in.tum.de/research/vslam/lsdslam
https://github.com/tum-vision/lsd_slam
阅读全文
0 0
- LSD-SLAM在Ubuntu14.04+indigo环境中编译运行
- 基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功
- 基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功
- Ubuntu14.04安装LSD-SLAM
- LSD-SLAM 编译过程(Ubuntu 14.04 + ROS Indigo)
- LSD-SLAM 编译过程(Ubuntu 14.04 + ROS Indigo
- LSD-SLAM 安装运行
- SLAM: Ubuntu14.04_Kylin安装ROS-Indigo
- 在Ubuntu14.04中安装ROS Indigo
- 在Ubuntu14.04中安装ROS Indigo
- 在Ubuntu14.04 中安装ROS Indigo
- Ubuntu 14.04+ROS Indigo+LSD-SLAM
- GOTURN算法在ubuntu14.04+only_cpu环境下编译运行
- ORB SLAM在Ubuntu14.04下环境配置
- ORB SLAM在Ubuntu14.04下环境配置
- ORB_SLAM运行详细过程(ubuntu14.04系统和ROS Indigo环境搭建,配置及测试运行)
- Ubuntu16.04 install lsd-slam
- Ubuntu16.04安装LSD-SLAM
- 数据库
- Oracle 时间 问题总结精华版
- 类的数组成员变量的初始化
- 2017网页设计还有什么值得关注的发展趋势
- edgesForExtendedLayout指定边缘要延伸的方向
- LSD-SLAM在Ubuntu14.04+indigo环境中编译运行
- grep用法
- [算法分析与设计] leetcode 每周一题: Set Matrix Zeroes
- 计算机科学导论
- JVM内存状况查看方法和分析工具
- nodejs 全局变量-global
- Linux下查看内核、CPU、内存及各组件版本的命令和方法
- 哎哎哎
- 添加 展示 清空