LSD-SLAM在Ubuntu14.04+indigo环境中编译运行
2017-10-08 14:51
751 查看
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
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
相关文章推荐
- LSD-SLAM 编译过程(Ubuntu 14.04 + ROS Indigo
- ORB_SLAM运行详细过程(ubuntu14.04系统和ROS Indigo环境搭建,配置及测试运行)
- LSD-SLAM 编译过程(Ubuntu 14.04 + ROS Indigo)
- 基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功
- 基于Ubuntu14.04+ROS indigo环境LSD-SLAM的数据集测试成功
- 编译安装及运行单目ORBSLAM2在Ubuntu14.04
- LSD-SLAM 环境搭建,编译,运行 2018年1月亲测可行
- Ubuntu 14.04+ROS Indigo+LSD-SLAM
- GOTURN算法在ubuntu14.04+only_cpu环境下编译运行
- 编译安装及运行单目ORBSLAM2在Ubuntu14.04
- Ubuntu 14.04 编译arm 环境配置
- 在Ubuntu 14.04(64bit)上搭建Android编译环境(通用版)
- ubuntu14.04 下安装sublime text3 并搭建C/C++编译环境
- Ubuntu14.04环境编译vlc源码for安卓Android系统
- Ubuntu 14.04 LNMP源码编译环境搭建 Nginx-1.9.1 PHP-5.6.9 Mariadb-10.0.19 完整教程
- ubuntu14.04,安装JDK1.8(JAVA程序需要的开发、运行环境)
- 如何在ubuntu14.04(64位)编译运行32位程序
- [置顶] ubuntu14.04 + ROS下编译Pangolin和ORB_SLAM2死机的解决办法