First introduce the environment configuration:
Raspberry Pi 3B+, Ubuntu mate 16.04, ROS kinetic, opencv2.4.13
Compilation method:
1. Install various required software packages and dependent libraries
$ sudo apt-get install libglew-dev
$ sudo apt-get install cmake
$ sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
$ sudo apt-get install libpython2.7-dev
$ sudo apt-get install libeigen3-dev
2. Install Pangolin
download, compile and install, forgot to record, haha.
3. Install the following dependencies
$ sudo apt-get install libblas-dev
$ sudo apt-get install liblapack-dev
4. Compile ORB-SLAM2 and
enter the ROS workspace. For Raspberry Pi, open the file build.sh first, and change all the make -j inside to make, otherwise it will crash easily, test it, and tears.
$ cd ~/catkin_ws/src
$ cd ORB_SLAM2-master //进入ORB-SLAM2文件夹里
$ chmod +x build.sh //更改文件属性,当然,用sudo的话这步就可以省了
$ ./build.sh
Compile ORB-SLAM2 under ROS
$ chmod +x build.sh
$ ./build_ros.sh //同上,电脑性能不好的记得改make -j为make
If the following error occurs: (I have this error)
undefined reference to symbol '_ZN5boost6system15system_categoryEv'
Then open the Example folder in the ORB-SLAM2 folder and open the ROS folder
$ cd ~/catkin_ws/src/ORB_SLAM2-master/Examples/ROS
Modify the CMakeLists.txt file inside. For the
reason, open build_ros.sh and look at the program inside.
Find it
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
)
Add -lboost_system and it is available for pro-test.
ps. Some references can't find the original blog. If you offend, please contact me to modify and mark accordingly.