ORB SLAM2安裝問題總結

2021-09-24 20:03:39 字數 4662 閱讀 3941

[rosbuild] building package orb_slam-master

[rosbuild] error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py/home/windistance/program/orb_slam2/examples/ros/orb_slam2

traceback (most recent call last):

file "/opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in

raise exception

exception

cmake error at /opt/ros/kinetic/share/ros/core/rosbuild/private.cmake:102 (message):

[rosbuild] rospack found package "orb_slam2" at "", but the current

directory is "/home/windistance/program/orb_slam2/examples/ros/orb_slam2". you should

double-check your ros_package_path to ensure that packages are found in the

correct precedence order.

call stack (most recent call first):

/opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)

cmakelists.txt:4 (rosbuild_init)

-- configuring incomplete, errors occurred!

see also "/home/windistance/program/orb_slam2/examples/ros/orb_slam2/build/cmakefiles/cmakeoutput.log".

在.bashrc 末尾新增:

export ros_package_path=$ros_package_path:/home/windistance/program/orb_slam2/examples/ros/orb_slam2
source ~/.bashrc
[  0%] built target rospack_genmsg_libexe

[ 0%] built target rosbuild_precompile

[ 22%] built target mono

[ 33%] linking cxx executable ../rgbd

[ 44%] linking cxx executable ../stereo

[ 77%] built target monoar

/usr/bin/ld: cmakefiles/rgbd.dir/src/ros_rgbd.cc.o: undefined reference to symbol '_zn5boost6system15system_categoryev'

/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: dso missing from command line

collect2: error: ld returned 1 exit status

cmakefiles/rgbd.dir/build.make:213: recipe for target '../rgbd' failed

make[2]: *** [

../rgbd] error 1

cmakefiles/makefile2:67: recipe for target 'cmakefiles/rgbd.dir/all' failed

make[1]: *** [cmakefiles/rgbd.dir/all] error 2

make[1]: *** 正在等待未完成的任務..

../usr/bin/ld: cmakefiles/stereo.dir/src/ros_stereo.cc.o: undefined reference to symbol '_zn5boost6system15system_categoryev'

/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: dso missing from command line

collect2: error: ld returned 1 exit status

cmakefiles/stereo.dir/build.make:213: recipe for target '../stereo' failed

make[2]: *** [

../stereo] error 1

cmakefiles/makefile2:104: recipe for target 'cmakefiles/stereo.dir/all' failed

make[1]: *** [cmakefiles/stereo.dir/all] error 2

makefile:127: recipe for target 'all' failed

make: *** [all] error 2

解決方案為

locate  boost_system //查詢位置

/usr/lib/x86_64-linux-gnu/libboost_system.a

/usr/lib/x86_64-linux-gnu/libboost_system.so

/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0

locate boost_filesystem //查詢位置

/usr/lib/x86_64-linux-gnu/libboost_filesystem.a

/usr/lib/x86_64-linux-gnu/libboost_filesystem.so

/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0

將libboost_system.so與libboost_filesystem.so複製到orb_slam2/lib下,並且將orbslam2/examples/ros/orbslam2下的cmakelists.txt中加入庫目錄,或者直接把查詢到的路徑加到庫目錄

set(libs $ $

$$/../../../thirdparty/dbow2/lib/libdbow2.so

$/../../../thirdparty/g2o/lib/libg2o.so

$/../../../lib/liborb_slam2.so

/usr/lib/x86_64-linux-gnu/libboost_system.so

/usr/lib/x86_64-linux-gnu/libboost_filesystem.so

)

再次編譯,問題解決:

[  0%] built target rospack_genmsg_libexe

[ 0%] built target rosbuild_precompile

[ 11%] linking cxx executable ../mono

[ 22%] linking cxx executable ../rgbd

[ 33%] linking cxx executable ../stereo

[ 44%] linking cxx executable ../monoar

[ 55%] built target rgbd

[ 66%] built target mono

[ 88%] built target monoar

[100%] built target stereo

安裝pangolin

cmake error at cmakemodules/findeigen.cmake:33 (file):

file failed to open for reading (no such file or directory):

/usr/include/eigen3/eigen/src/core/util/macros.h

call stack (most recent call first):

cmakemodules/findeigen.cmake:57 (_eigen3_check_version)

tools/cmakelists.txt:11 (find_package)

-- configuring incomplete, errors occurred!

sudo

cp -r /usr/local/include/eigen3 /usr/include

重新編譯問題解決

ORB SLAM2中遇到問題

報錯 error while loading shared libraries libpangolin.so cannot open shared object file no such file or directory 解決 大致的問題是出在,通過原始碼包進行安裝時,如果不指定 prefix會將...

ORB SLAM2 定位模式

void load const string filename,systemsetting mysystemsetting,keyframedatabase mpkeyframedatabase 別忘了新增標頭檔案和命名空間中的類宣告。同樣,需要在map.cc檔案中修改load 函式。laod 函式...

ORBSLAM2之LocalMapping執行緒

一 處理新關鍵幀processnewkeyframe 五 區域性ba 六 刪除冗餘關鍵幀keyframeculling 七 將當前關鍵幀插入閉環檢測佇列 更新當前關鍵幀的共檢視updateconnections a 遍歷當前關鍵幀的mp,更新共檢視 b 更新當前關鍵幀的子關鍵幀與父關鍵幀 i.與當前...