目标检测与位姿估计(十六):ORB-SLAM在ROS上编译运行常见问题解决方案

本文档记录了ORB-SLAM2在部署过程中遇到的三个问题及其解决方法:1) CMakeError通过修改.bashrc文件解决;2) 缺少libg2o.so库,通过执行./build.sh和./build_ros.sh解决;3) undefined reference to symbol问题,通过在CMakeLists.txt中添加-lboost_system解决链接错误。
摘要由CSDN通过智能技术生成

https://blog.csdn.net/u014709760/article/details/85253525

可参考上述连接进行。遇到些问题。

    1. 问题一解决CMake Error

$gedit ~/.bashrc

在文件最后添加一行,下行路径根据自己电脑的实际路径填写,例如我的是:

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/a/slamws/src/ORB_SLAM2/Examples/ROS

 

    1. 问题二解决libg2o.so

。。。。。

[  0%] Built target rosbuild_precompile

make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../RGBD'.  Stop.

CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed

make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

先执行./build.sh

再执行./build_ros.sh,OK.

    1. 问题三解决undefined reference to symbol

[ 11%] Linking CXX executable ../RGBD

/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:216: 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

Makefile:127: recipe for target 'all' failed

make: *** [all] Error 2

方法:

$gedit ./Examples/ROS/ORB_SLAM2/CMakeLists.txt

添加一行-lboost_system

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值