ORB_SLAM2编译及试运行(含ROS)

2023-05-16

ORB-SLAM2

  • github project link
  • ORB-SLAM2的安装与运行

Build and examples

cd ORB_SLAM2
chmod +x build.sh
./build.sh

ERROR 1

/home/hazyparker/project/ORB_SLAM2/src/System.cc: In member function ‘cv::Mat ORB_SLAM2::System::TrackStereo(const cv::Mat&, const cv::Mat&, const double&)’:
/home/hazyparker/project/ORB_SLAM2/src/System.cc:134:17: error: ‘usleep’ was not declared in this scope
                 usleep(1000);
                 ^~~~~~
/home/hazyparker/project/ORB_SLAM2/src/System.cc:134:17: note: suggested alternative: ‘fseek’
                 usleep(1000);
                 ^~~~~~
                 fseek
/home/hazyparker/project/ORB_SLAM2/src/System.cc: In member function ‘cv::Mat ORB_SLAM2::System::TrackRGBD(const cv::Mat&, const cv::Mat&, const double&)’:
/home/hazyparker/project/ORB_SLAM2/src/System.cc:185:17: error: ‘usleep’ was not declared in this scope
                 usleep(1000);
                 ^~~~~~
/home/hazyparker/project/ORB_SLAM2/src/System.cc:185:17: note: suggested alternative: ‘fseek’
                 usleep(1000);
                 ^~~~~~
                 fseek
/home/hazyparker/project/ORB_SLAM2/src/System.cc: In member function ‘cv::Mat ORB_SLAM2::System::TrackMonocular(const cv::Mat&, const double&)’:
/home/hazyparker/project/ORB_SLAM2/src/System.cc:236:17: error: ‘usleep’ was not declared in this scope
                 usleep(1000);
                 ^~~~~~
/home/hazyparker/project/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::Run()’:
/home/hazyparker/project/ORB_SLAM2/src/LoopClosing.cc:84:9: error: ‘usleep’ was not declared in this scope
         usleep(5000);
         ^~~~~~
CMakeFiles/ORB_SLAM2.dir/build.make:110: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o] Error 1
make[2]: *** 正在等待未完成的任务....
CMakeFiles/ORB_SLAM2.dir/build.make:86: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Tracking.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Tracking.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:494: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:134: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o] Error 1
CMakeFiles/ORB_SLAM2.dir/build.make:62: recipe for target 'CMakeFiles/ORB_SLAM2.dir/src/System.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/System.cc.o] Error 1
CMakeFiles/Makefile2:252: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

search key: ‘usleep’ was not declared in this scope

result: 编译orbslam2出现的error: ‘usleep’ was not declared in this scope usleep(3000), fixed

ERROR 2

[ 62%] Linking CXX shared library ../lib/libORB_SLAM2.so
/usr/bin/ld: 找不到 -lEigen3::Eigen
collect2: error: ld returned 1 exit status
CMakeFiles/ORB_SLAM2.dir/build.make:624: recipe for target '../lib/libORB_SLAM2.so' failed
make[2]: *** [../lib/libORB_SLAM2.so] Error 1
CMakeFiles/Makefile2:252: recipe for target 'CMakeFiles/ORB_SLAM2.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

search key: /usr/bin/ld:找不到-lEigen3::Eigen

result: ORB SLAM2 编译报错 /usr/bin/ld:找不到 -lEigen3::Eigen

issue1

version of Pangolin is 0.6, however, orb slam2 needs 0.5

issue2

change REQUIRED to REQUIRED NO_MOUDLE, NO_MODULE可以用来明确地跳过模块模式。它也隐含指定了不使用在精简格式中使用的那些选项。

end: change REQUIRED to REQUIRED NO_MOUDLE, fixed and finished

TUM dataset example

cd orb slam2 file, then

$ ./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
  • Link to TUM1 dataset
  • PATH_TO_SEQUENCE_FOLDER, path to the dataset that unzipped
  • TUMX.yaml , X depends on dataset

Build in ROS

  • copy ORB_SLAM2 to catkin_ws/src
  • add Path, export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/catkin_ws/src/ORB_SLAM2/Examples/ROS to .bashrc
  • source ~/.bashrc

While using camera via USB, pay attention to Info below:

ORB-SLAM默认订阅的话题为/camera/image_raw,而usb_cam节点发布的话题为/usb_cam/image_raw,因此需要在ros_mono.cc中修改订阅的话题,这点要特别注意。因为源文件的更改必须要重新编译,这非常耗时

from https://blog.csdn.net/learning_tortosie/article/details/79881165

a more precise tutorial ROS编译ORB-SLAM2运行

If applied in gazebo, then just build like this: (in file catkin_ws/src/ORB_SLAM2)

chmod +x build_ros.sh
./build_ros.sh

ERROR 1

/home/hazyparker/下载/Pangolin-master/components/pango_opengl/include/pangolin/gl/opengl_render_state.h:40:10: fatal error: Eigen/Core: 没有那个文件或目录
 #include <Eigen/Core>
          ^~~~~~~~~~~~
compilation terminated.
CMakeFiles/RGBD.dir/build.make:118: recipe for target 'CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o' failed
make[2]: *** [CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2
CMakeFiles/Stereo.dir/build.make:118: recipe for target 'CMakeFiles/Stereo.dir/src/ros_stereo.cc.o' failed
make[2]: *** [CMakeFiles/Stereo.dir/src/ros_stereo.cc.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]: *** [CMakeFiles/Stereo.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

issue about Eigen, no such file or directory

  • 解决 fatal error: Eigen/Core: No such file or directory
  • Sophus库安装踩坑(SLAM十四讲)

Be advised, I installed eigen3 on my own, so it exists in usr/local/include/eigen3. According to the 2nd reference, I’ve uninstalled eigen3.2 so that there is nothing in path usr/include/eigen3.

Aware of this, I shall use ln -s method to create a link to usr/local/include/eigen3.

sudo ln -s /usr/local/include/eigen3/Eigen /usr/include/Eigen

then I can find Eigen in usr/include/.

ERROR 2

after ERROR 1

CMake Error at CMakeLists.txt:42 (find_package):
  Found package configuration file:

    /home/hazyparker/下载/Pangolin-master/build/PangolinConfig.cmake

  but it set Pangolin_FOUND to FALSE so package "Pangolin" is considered to
  be NOT FOUND.  Reason given by package:

  Pangolin could not be found because dependency Eigen3 could not be found.



-- Configuring incomplete, errors occurred!
See also "/home/hazyparker/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
See also "/home/hazyparker/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeError.log".
Makefile:724: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

Solution in ERROR 1 caused:Pangolin could not be found because dependency Eigen3 could not be found.

same issue with issue 1015 https://github.com/raulmur/ORB_SLAM2/issues/1015, same issue of Build and examples ERROR 1

firstly, I add include_directories("/usr/local/include/eigen3") in CMakeList.txt, but it won’t work

secondly, I revised find_package(Eigen3 3.1.0 REQUIRED NO_MODULE) to find_package(Eigen3 3.1.0 REQUIRED), but it won’t work either

An idea, delete the link created in Build in ROS ERROR 1, use sudo apt-get install libeigen3-dev instead(which means eigen3.2). When eigen 3.3 is needed, add include_directories("/usr/local/include/eigen3") in CMakeList.txt rather than find_package.

failed.

It just occurred me that ROS owns a seperated CMakeList.txt in ORB_SLAM2/Examples/ROS/ORB_SLAM2

So, changing find_package(Eigen3 3.1.0 REQUIRED) to find_package(Eigen3 3.1.0 REQUIRED NO_MODULE) in CmakeLists.txtof ROS

fixed.

ERROR 3

/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: 无法添加符号: 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: 无法添加符号: 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:129: recipe for target 'all' failed
make: *** [all] Error 2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ORB_SLAM2编译及试运行(含ROS) 的相关文章

  • PX4-3-uORB

    uORB Micro Object Request Broker 微对象请求代理器 是PX4中非常重要且关键的一个模块 xff0c 用于各个模块之间的数据交互 实际上uORB是一套跨 进程 的IPC通讯模块 在PX4中 xff0c 所有的功
  • PX4-5-SPI-IIC设备驱动

    在之前的分享中 xff0c 我们聊了PX4的通信框架和任务调度框架 xff0c 现在我们讲一下PX4的设备驱动 PX4支持很多种设备 xff0c 根据通信方式的不同大致分为 xff1a SPI IIC设备 串口设备 IO设备 CAN设备 这
  • PX4-6-串口设备驱动

    上一篇我们讲了PX4的SPI IIC设备驱动 xff0c 现在讲一下PX4的串口设备 PX4的串口设备驱动框架比SPI IIC设备简单不少 xff0c 使用了两种底层实现方式 xff1a 一种是系统自带的标准字符设备接口 xff0c 一种是
  • Uav开发杂记-4-无人机开发的C-C++

    无人机的软件开发主要使用C C 43 43 开发 xff0c APM和PX4的应用层开发更多的使用C 43 43 开发 作为叠代完善了非常多年的比较大型的开源飞控项目 xff0c 其代码框架对于刚开始接触的新手而言是比较复杂的 一些同学私信
  • AcmeIot-3-在嵌入式设备中运行ROS2

    ROS2是作为第二代ROS xff0c 对ROS1进行了重大的优化 xff0c 主要的特点有 xff1a 实现跨平台运行 xff0c 可以运行在Linux windows Mac RTOS xff0c 甚至没有操作系统的裸机 实现真正的分布
  • PX4-12-飞行任务框架

    飞行任务指的是PX4的modules flight mode manager组件 xff0c 用于控制指令平滑 PX4的FlightTask框架设计还是比较有趣的 xff0c 不论从软件架构还是控制算法方面 xff0c 都是值得好好学习的代
  • AcmeROS-2-ROS2架构

    在前面的分享中 xff0c 我们讲了 在嵌入式设备中运行ROS2 AcmeIot 3 在嵌入式设备中运行ROS2 PX4中的ROS2桥接应用 PX4 16 ROS2Bridge 在AcmeGCS中支持ROS2 AcmeGCS 18 支持RO
  • 自动驾驶控制算法-模型预测MPC

    本文记录一下MPC控制算法的学习过程和自己的理解 xff0c 初步接触控制算法 xff0c 理解肯定不是很完善 xff0c 重在记录思考的过程 背景 随着自动驾驶技术以及机器人控制技术的不断发展及逐渐火热 xff0c 模型预测控制 MPC
  • MySQL保留2位小数

    1 round x d xff0c 四舍五入 round x 其实就是round x 0 也就是默认d为0 select round 109 456 2 109 46 2 TRUNCATE x d xff0c 直接截取需要保留的小数位 se
  • PCB原理图绘制(种草立创eda)

    首先 xff0c 相对于我们平时所用的ad 这个就很适合我们英文不好的中国人了 然后这个一站式搞定 xff0c 画完商城下单就可以做我们的板子了 整个设计界面也很友好 xff0c 封装库也不需要我们自己封装 很多商城里面都有 xff0c 可
  • 操作系统学习-练习题个人总结(三)

    操作系统学习 练习题个人总结 xff08 三 xff09 第二章 操作系统硬件基础 一 第二章 中断和特权级 课前测试 1 错题解析 从用户态到内核态的转换是由 xff08 中断硬件 xff09 完成的 解析 xff1a 扩展资料 xff1
  • c++转换python返回的字符串

    PyArg Parse可以将python返回参数转换为c 43 43 类型 对于字符串转换用 xff0c 如下方法 xff1a xff08 格式必须这样 xff0c 其他方式都转换不了 xff09 char p 61 NULL PyArg
  • Esp8266天猫精灵_RGB灯_非点灯平台

    arduino接入阿里云 天猫精灵 云智能APP RGB灯 鉴于很多平台的物联网设备数量都受到限制 xff0c 比如说blinker xff0c 免费的只有5个 xff0c 使用了物联网里的老大哥阿里云 xff0c 性能稳定 xff0c 生
  • C++day09 类域(全局作用域、类作用域、块作用域)和深拷贝、写时复制、短字符串优化、第三方库优化短字符

    文章目录 1 总体目录框架2 类域 xff08 1 xff09 全局作用域 xff08 2 xff09 类作用域 xff08 3 xff09 块作用域 xff08 4 xff09 具体代码 3 std string底层实现 1 总体目录框架
  • 一天入门TM4C123GH6PM(从STM32进行比较学习)

    从STM32到TM4C123 主要内容 xff1a 一 系统时钟 二 GPIO相关 三 通用定时器相关 四 PWM相关 五 UART通信相关 写在前面 xff1a 进入TI的学习 xff0c 说明STM32 已经掌握的差不多了 xff0c
  • ffmpeg 报错Encoder (codec h264) not found for output stream #0:0

    使用ffmpeg 制作流媒体的视频文件 同样的命令在本地的windows环境是正常的 xff0c 在linux 上就不行了 报错了 根据最后一行的提示 xff0c Encoder codec h264 not found for outpu
  • Datax定时增量读取MongoDB到本地配置文件

    Datax定时增量读取MongoDB到本地配置文件 功能 1 gt DataX实现读取MongDB 2 gt 按照时间增量读取 3 gt 定时执行 xff08 使用调度工具自行实现 xff09 代码 span class token pun
  • 我们为什么需要自动化运维?

    随着企业服务器和交换机数量越来越多 xff0c 当到达几百台 xff0c 上千台服务器和交换机之后 xff0c 服务器和交换机日常管理也逐渐繁杂 xff0c 每天如果通过人工去频繁的更新或者部署及管理这些服务器和交换机 xff0c 势必会浪
  • C语言字符数组与字符串的使用及加结束符'\0'的问题

    1 字符数组的定义与初始化 字符数组的初始化 xff0c 最容易理解的方式就是逐个字符赋给数组中各元素 char str 10 61 I a m h a p p y 即把10个字符分别赋给str 0 到str 9 10个元素 如果花括号中提
  • Ubuntu之桌面安装及启动级别切换

    一 需求说明 某开发测试环境操作系统为Ubuntu20 04 给开发人员安装了xrdp 一次远程桌面连接过程中异常奔溃后无法再次远程连接 重启xrdp服务后所有人连接远程连接均出现闪退 为了进一步排查和测试需要搭建一个xrdp测试环境 当前

随机推荐

  • 如何将windows中的文件上传到虚拟机中?

    今天在linux系统中装了mysql xff0c 本来是用wget命令在官网下载的 xff0c 后来实在是慢 等了几分钟实在看不下去每秒十几k的下载速度 xff0c 于是将这个压缩包 xff08 tar xz结尾 xff09 下载到了win
  • 使用SQLyog连接Linux(CentOS版本)下的MySQL8数据库报2003以及1045错误的解决方法

    今天想尝试一下mysql的图形化管理工具 xff0c 于是下载了SQLyog xff0c 连接时却遇到了以下错误 xff1a 其中192 168 0 10是我linux下设置的inet xff0c 我们是通过它远程连接数据库 xff0c 这
  • servlet 学习笔记3

    1 会话 a 定义 xff1a 一个浏览器与一个服务端的一次完整的交流 b 特点 xff1a 在一次会话过程中 xff0c 经历多次请求与响应 在一次会话过程中 xff0c 同一个浏览器往往访问多个Servlet c 需求 xff1a 在一
  • JDBC 学习笔记2

    1 处理查询结果集 xff08 遍历结果集 xff09 span class token keyword package span test span class token punctuation span span class toke
  • JDBC 学习笔记3

    1 对比Statement与PreparedStatement Statement存在sql注入问题 xff0c PreparedStatement解决了sql注入问题 Statement是编译一次执行一次 xff0c PreparedSt
  • memset函数使用方法

    memset 函数及其作用 memset 函数原型是extern void memset void buffer int c int count buffer xff1a 为指针或是数组 c xff1a 是赋给buffer的值 count
  • 补码和原码的转化过程

    在计算机系统中 xff0c 数值一律用补码来表示 xff08 存储 xff09 主要原因 xff1a 使用补码 xff0c 可以将符号位和其它位统一处理 xff1b 同时 xff0c 减法也可按加法来处理 另外 xff0c 两个用补 码表示
  • 在ubuntu系统下安装缺少的字体(一般缺少中文字体)

    在ubuntu系统下安装缺少的字体 cite Ubuntu LaTeX 环境配置 https www cnblogs com xqmeng p 13931222 html 第一步 xff1a 下载缺少的字体 xff08 这里保证下载字体的名
  • 【数学知识】质数与质因子

    一 质数 1 概念 质数又称素数 一个大于1的自然数 xff0c 除了1和它自身外 xff0c 不能被其他自然数整除的数叫做质数 xff0c 否则称为合数 规定1既不是质数也不是合数质数的个数是无穷的 2 例题 xff1a AcWing 3
  • ElasticSearch7.6.2安装与简单操作

    ElasticSearch7 6 2安装与简单操作 Es系列工具都是开箱即用 xff0c 所以安装比较简单 xff0c 各个系统下都是解压即可 前置环境 xff1a windows10 ES7 6 2 Kibana7 6 2 xff1a E
  • 【填坑】海思wifi平台Hi3861开发(上) -- 搭建环境篇

    文章目录 背景处处坑1 编译环境Ubuntu Python报错去找客户新虚拟机OK 2 开发SDK 背景 近期在海思的一款wifi模组Hi3861V100上开发 xff0c 想来和ESP模组应该很像 xff0c 心情还是很放松的 xff0c
  • 小白带你入坑四旋翼无人机——物料篇

    之前就想写了 xff0c 但是比赛挺忙 xff0c 就搁置下来了 xff0c 现在比完了刚好在记录一下 就在一个月前 xff0c 我真正开始了和四旋翼无人机打交道 当时 xff0c 我还是一个小白 xff0c 对无人机什么都不了解 xff0
  • 无人机pid调节顺口溜

    今天无意中找到 xff0c 具体那位大佬编的我也不清楚 xff0c 先感谢一下吧 参数整定找最佳 xff0c 从小到大顺序查 先是比例后积分 xff0c 最后再把微分加 曲线振荡很频繁 xff0c 比例度盘要放大 曲线漂浮绕大弯 xff0c
  • 锐捷(五)交换机简单网络管理协议(SNMP)的配置

    要求 xff1a 在交换机上部署SNMP功能 1 向主机 172 16 0 254 发送 Trap 消息 xff0c 版本采用V2C 2 读写的Community为 admin 只读的Community为 public 3 开启Trap消息
  • torch-geometric使用过程中的问题

    这次记录自己在使用torch geometric时 xff0c 出现的各种问题 xff1a 1 安装问题 xff1a Python 3 8torch geometric 1 6 1pytorch 1 6 0pandas 1 0 5numpy
  • Jetson Xavier NX

    Jetson Xavier NX 96 提示 xff1a 记录学习过程 xff0c 倘若有抄袭请原谅 文章目录 Jetson Xavier NX前言一 安装系统二 烧镜像三 启动系统打开风扇先 四 配置VNC xff08 此处借鉴 xff0
  • 破片飞散角矢量绘制

    破片飞散角仿真 Gurney公式 xff1a 计算破片初速度 v 0 61 2 E
  • MATLAB二维图形坐标变换

    图形绘制及坐标变换 矩形的绘制和坐标变换示例 MATLAB代码 思考为什么用MATLAB xff1f 矩阵适合作坐标变换 xff0c 而C语言的数组则较为麻烦 xff0c 需要创建二维数组 xff0c 写for循环 xff1b 方法一 xf
  • 毁伤评估总结

    毁伤评估总结 计算部分 xff08 1 xff09 破片飞散速度计算 Gurney公式 xff1a 计算破片初速度 v 0 61 2
  • ORB_SLAM2编译及试运行(含ROS)

    ORB SLAM2 github project linkORB SLAM2的安装与运行 Build and examples span class token function cd span ORB SLAM2 span class t