在Ubuntu 16系统上,利用数据集运行RGBDSLAM_V2
前言:这是一条没有截图的随笔。。。
1.建立rgbdslam_ws空间
$ mkdir -p ~/rgbdslam_ws/src
$ cd ~/rgbdslam_ws/src
$ cd rgbdslam_ws
$ catkin_make
将工作空间下的 devle/setup.bash 写入.bashrc文件,之后执行
$ source ~/.bashrc
2.下载并安装依赖库
(偷懒)一键安装脚本
点击链接 https://raw.githubusercontent.com/felixendres/rgbdslam_v2/kinetic/install.sh
将内容复制,保存为一个.sh文件
直接在该.sh文件路径下执行指令 $bash xxx.sh
注:需要手动安装PCL 1.8,参考下边安装PCL 1.8过程,必须为1.8。1.9、1.7我都试过,并且修改了相应位置,编译始终没法通过
然后接着从3开始做即可
2.1安装依赖
1 sudo apt-get install -y git build-essential linux-libc-dev
2 sudo apt-get install -y cmake cmake-gui
3 sudo apt-get install -y libusb-1.0-0-dev libusb-dev libudev-dev
4 sudo apt-get install -y libqhull* libgtest-dev
5 sudo apt-get install -y libgl1-mesa-dev
6 sudo apt-get install -y libxt-dev
7 sudo apt-get install -y freeglut3-dev pkg-config
8 sudo apt-get install -y libxmu-dev libxi-dev
9 sudo apt-get install -y mpi-default-dev openmpi-bin openmpi-common
10 sudo apt-get install -y mono-complete
11 sudo apt-get install -y libopenni-dev
12 sudo apt-get install -y libopenni2-dev
2.2下载安装Eigen3.0、FLANN、OPENGL、PCAP、BOOST、X11、ZLIB、PNG、glew
1 sudo apt-get install libeigen3-dev
2 sudo apt-get install -y libflann1.8 libflann-dev
3 sudo apt-get install -y build-essential libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
4 sudo apt-get install libpcap-dev
5 sudo apt-get install -y libboost-all-dev
6 sudo apt-get install -y libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev
7 apt-get install zlib1g zlib1g-dev
8 sudo apt-get install libpng-dev
9 sudo apt install libglew-dev
2.3安装QT(这个和VTK 好像是可选的,之前忘了做记录,如果报 没有这个依赖的错,再安装吧)
2.4安装VTK
2.5安装PCL1.8(必须为1.8.0版本,1.7和1.9都不行)
cd ~/rgbdslam_vs/src
wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz
tar -xvzf pcl-1.8.0.tar.gz
cd pcl-pcl-1.8.0 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
2.6下载安装特定版本的G2O
sudo apt-get install libsuitesparse-dev
sudo apt install libdevil-dev
cd rgbdslam_vs/src
git clone https://github.com/felixendres/g2o.git
cd ~/rgbdslam/src/g2o
mkdir build
cd build
cmake ..
make
sudo make install
3.安装ROS
传送门:http://wiki.ros.org/cn/kinetic/Installation/Ubuntu
4. 下载安装rgbdslam
cd ~/rgbdslam_ws/src
wget -q http://github.com/felixendres/rgbdslam_v2/archive/kinetic.zip
unzip -q kinetic.zip
cd ~/rgbdslam_ws/
rosdep update
rosdep install rgbdslam
5. 编译rgbdslam_v2
@1在rgbdslam_v2包的cmakelists.txt文件下的第6行加入
add_compile_options(-std=c++11)
@2将rgbdslam_v2包下的cmakelist.txt文件的第79行
find_package(PCL 1.7 REQUIRED COMPONENTS common io)
改为
find_package(PCL 1.8 REQUIRED COMPONENTS common io)
@3编译
cd rgbdslam_ws
catkin_make
6. 配置环境
(添加rgbdslam_ws工作空间到.bashrc文件下)
echo "source /home/XXXX/rgbdslam_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
7. 运行数据集
打开第一个终端
roscore
打开第二个终端
rosbag play XXX.bag(下载的数据集包名及路径,注意下载bag格式的数据集)
打开第三个终端
roslaunch rgbdslam rgbdslam.launch