ubuntu16.04用usb摄像头跑orb-slam2

ubuntu16.04用usb摄像头跑orb-slam2

    • 实验环境
    • 参考教程
    • opencv安装
    • ROS安装
    • 报错及解决方案

实验环境

笔记本:战神Z&M-KP5SC Inter Core i5-8300H处理器 NVIDIA GTX1050Ti显卡
Ubuntu 16.04 + Ros Kinetic + Opencv3.4.5

参考教程

https://blog.csdn.net/zhangqian_shai/article/details/86700866
https://www.jianshu.com/p/dbf39b9e4617

opencv安装

参考:https://www.cnblogs.com/fighting25/archive/2019/04/11/10687564.html

ROS安装

参考:https://www.jianshu.com/p/68f88e377850

整个环境配置流程基本上参考上述链接中的方法,在这里我就在赘述,重点讨论一下配置过程中出现的一些报错信息及解决方案

报错及解决方案

报错1
ubuntu16.04用usb摄像头跑orb-slam2_第1张图片出错原因为:libboost_system.so 与libboost_filesystem.so找不到链接目录
解决方案为:

c@c:~$ 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
c@c:~$ 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_system.so.1.58.0 libboost_filesystem.so libboost_filesystem.so.1.58.0 复制到ORB_SLAM2/lib下,并且将ORBSLAM2/Examples/ROS/ORBSLAM2下的Cmakelists.txt中加入库目录,具体为

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
之后加入${PROJECT_SOURCE_DIR}/../../../lib/libboost_filesystem.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_system.so

报错2
在配置ROS时可能会出现以下错误
在这里插入图片描述在终端里写入

killall -9 roscore
killall -9 rosmaster

即可解决

你可能感兴趣的:(代码实现)