Because the only Kinect V1 on hand is not V2, and the online implementation of ORB-SLAM2 is based on Kinect2, the most famous Gaobo to implement Http://www.cnblogs.com/gaoxiang12/p/5161223.html. By referring to some of the data, the Kinect1 realized the ORB-SLAM2, here summarizes the concrete steps.
1. My system:
Ubuntu14.04, ROS Indigo,lenovo Z485, Kinect V1.
2. Dependency installation , refer to Orb-slam2 's Prerequisites (dependencies) section
2.1 Boost
sudo apt-get install libboost-all-dev
2.2 ROS 安装的是indigo
(http://wiki.ros.org/indigo/Installation/Ubuntu)
2.3 OpenCV 安装的是OpenCV2.4.11
2.4 g2o
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
sudo apt-get install libeigen3-dev
2.5
DBoW2 (included in ThirdParty) is not installed in the ThirdParty folder of Orb-slam2.
3. Installing ORB-SLAM2refer to the installation of Orb-slam2Part
3.1 Downloadsgit clone https://github.com/raulmur/ORB_SLAM.git (可以直接放在home下,然后解压)
3.2 修改.bashrc,加入
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH_TO_PARENT_OF_ORB_SLAM (红色字体是需要修改的内容,改为ROS文件夹下的ORB-SLAM2路径)
gedit .bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/zfy/ORB-SLAM2/Examples/ROS (根据需要,红色字体改为对应的路径)
3.3 编译g2o, cd到Thirdparty/g2o/,然后执行:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
3.4 编译DBoW2, cd到Thirdparty/DBoW2/,然后执行:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
4
. Installing the Kinect V1 driver
sudo apt-get install Libfreenect-dev
sudo apt-get install Ros-indigo-freenect-launch
Roslaunch Freenect_launch freenect.launch Verify that the Kinect driver is installed successfully;
Rostopic List View orb-slam2 required two topic:/camera/rgb/image_raw /camera/depth_registered/image_raw
5. Configuring the launch file
Create a new file Kinect_orbslam2.launch in the root directory of the extracted orb-slam2, with the contents of(根据需要,红色字体改为对应的路径,其他的无需修改)
<launch>
<param name= "Orb_use_viewer" value= "false"/>
<node pkg= "orb_slam2" type= "RGBD" name= "Orb_slam2"
Args= "/home/zfy/orb_slam2/vocabulary/orbvoc.txt
/home/zfy/orb_slam2/examples/rgb-d/tum1.yaml"Cwd=" Node "output=" screen "/>
<include file= "$ (find Freenect_launch)/launch/freenect.launch" >
<!--use device registration--
<arg name= "Depth_registration" value= "true"/>
<arg name= "rgb_processing" value= "true"/>
<arg name= "ir_processing" value= "false"/>
<arg name= "depth_processing" value= "false"/>
<arg name= "depth_registered_processing" value= "true"/>
<arg name= "disparity_processing" value= "false"/>
<arg name= "disparity_registered_processing" value= "false"/>
<arg name= "sw_registered_processing" value= "false"/>
<arg name= "hw_registered_processing" value= "true"/>
</include>
</launch>
6. Running Orb-slam2
CD ORB-SLAM2
./build.sh
Roslaunch Kinect_orbslam2.launch
结果如:
Orb-slam2 with Kinect V1