说明:Ubuntu 16.04以及必要的基础软件安装完成之后进行;
1.OpenNI2安装(可选)
安装依赖项:
sudo apt-get install -y g++ python libusb-1.0--dev freeglut3-dev doxygen graphviz
sudo apt-get install libudev-dev
安装:
sudo apt-get install libopenni2-dev
检查测试:
pkg-config --modversion libopenni2
2.PCL 1.7 安装:
https://www.cnblogs.com/haijian/p/8678189.html
3.OpenCV 2.4.3以上版本 安装:
https://www.cnblogs.com/haijian/p/9734538.html (示例为OpenCV-3.4.3)
4.安装PangoLin
安装依赖项:
sudo apt-get install libglew-dev libpython2.-dev
下载源码包:
git clone https://github.com/stevenlovegrove/Pangolin.git
编译
cd Pangolin
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8
sudo make install
5.ORB_SLAM2编译
cd ORB_SLAM2
sudo chmod +x build.sh
./build.sh
6.数据集测试
下载数据集(以mono为例)
http://vision.in.tum.de/data/datasets/rgbd-dataset/download
终端运行(mono)
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
若使用RGBD,需要使用图片序列汇集信息,请参考associate.py 源代码 及 使用方法
https://www.cnblogs.com/haijian/p/10848607.html
-----------------------------------------ROS_ORB_SLAM2-----------------------------------------
ROS安装
https://www.cnblogs.com/haijian/p/8782560.html
Kinect V2驱动安装(如果不使用,可不装)
https://www.cnblogs.com/haijian/p/9734624.html
ORB_SLAM2_ROS编译
更改~/ORB_SLAM2-master/Examples/ROS/ORB_SLAM2/src/ros_mono.cc中(更改接口,否则运行黑屏)
ros::Subscriber sub = nodeHandler.subscribe("/camera/image_raw", 1, &ImageGrabber::GrabImage,&igb);
>
ros::Subscriber sub = nodeHandler.subscribe("/usb_cam/image_raw", 1, &ImageGrabber::GrabImage,&igb);
编译:
cd ~/ORB_SLAM2/Examples/ROS/ORB_SLAM2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8
安装USB_CAM测试
https://www.cnblogs.com/haijian/p/10847457.html
测试
终端1:
source ~/catkin_ws/devel/setup.bash
roslaunch usb_cam usb_cam-test.launch
终端2:
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/××/ORB_SLAM2_modified/Examples/ROS
rosrun ORB_SLAM2 Mono ~/ORB_SLAM2-master/Vocabulary/ORBvoc.txt ~/ORB_SLAM2-master/Examples/Monocular/TUM1.yaml