【ORB-SLAM3】Ubuntu20.04 使用 RealSense D435i 运行 ORB-SLAM3 时遇到的一些 Bug

【ORB-SLAM3】使用 RealSense D435i 跑 ORB-SLAM3 时遇到的一些 Bug

  • [1 hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready)](#1 hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready))
  • [2 No rule to make target '/opt/ros/noetic/lib/x86_64-linux-gnu/librealsense2.so', needed by '../lib/libORB_SLAM3.so'](#2 No rule to make target '/opt/ros/noetic/lib/x86_64-linux-gnu/librealsense2.so', needed by '../lib/libORB_SLAM3.so')

1 hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready)

问题描述:

运行 ./Examples/Stereo-Inertial/stereo_inertial_realsense_D435i Vocabulary/ORBvoc.txt ./Examples/Stereo-Inertial/RealSense_D435i.yaml 时,报错如下:

txt 复制代码
terminate called after throwing an instance of 'rs2::invalid_value_error'
 what(): hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready)

解决方法:

受到这个 issue: Link 的启发,想到自己为了省事,而选择了直接通过 apt 来安装 RealSense ROS,可能导致了相机固件、RealSense SDK 和 RealSense ROS 三者之间的版本不匹配。

  1. 卸载 apt 安装的 RealSense ROS
bash 复制代码
sudo apt remove ros-noetic-realsense2-camera
sudo apt install ros-noetic-realsense2-description
sudo apt autoremove
  1. 通过源码编译安装,具体步骤详见我的这篇文章: Link

2 No rule to make target '/opt/ros/noetic/lib/x86_64-linux-gnu/librealsense2.so', needed by '.../lib/libORB_SLAM3.so'

问题描述:

我通过源码编译安装 RealSense ROS 后,重新对 ORB-SLAM3 进行了编译,执行 ./build.sh 时,报错如下:

txt 复制代码
make[2]: *** No rule to make target '/opt/ros/noetic/lib/x86_64-linux-gnu/librealsense2.so', needed by '../lib/libORB_SLAM3.so'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:971: CMakeFiles/ORB_SLAM3.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

解决方法:

我首先查看了 ORB-SLAM3 的 CMakeLists.txt 文件,发现不存在 target_link_libraries() 语句中的第三方库指向 /opt/ros/noetic/lib/x86_64-linux-gnu/librealsense2.so 这个路径,而这个路径正是我之前使用 apt 安装 RealSense ROS 创建的,卸载之后就不存在了,这个问题让我疑惑了很久。

当我看到 build/CMakeFiles/mono_euroc.dir/build.make 文件中存在这个路径(图 1),并配合 CMakeLists.txt 中的 target_link_libraries() 中第三方库的顺序(图 2),我觉得是 Pangolin 的原因。

当我看到 Pangolin 文件夹里存在 CMakeModules/FindLibRealSense2.cmake 时,更加印证了我的想法,真的没想到 Pangolin 也会用到 Realsense SDK 的库文件。

出现这个问题相当于 ORB-SLAM3 依赖 Pangolin,Pangolin 依赖 Realsense SDK,层层嵌套,最内层出现了问题,所以我重新编译安装了 Pangolin。

  1. 重新编译安装 Pangolin
bash 复制代码
cd ~/3rdparty/Pangolin-0.6

rm -rf build
cmake -B build
cmake --build build			
sudo cmake --install build 	
  1. 编译 ORB-SLAM3
bash 复制代码
rm -rf build
./build.sh
相关推荐
一切皆有可能!!1 天前
【SoduWork测评】本机跑源码,找到并修了7个Bug
windows·开源·bug·ai编程·soduwork
2601_967987375 天前
程序员遇到BUG的解释
程序员·bug·软件开发·调试·幽默
jianqiang.xue5 天前
线程一切换浮点全作废:五天修好的隐秘bug
bug
江湖有缘6 天前
基于Ubuntu部署SoduWork:企业级 AI 原生协同平台实战全流程
linux·人工智能·ubuntu·ai·soduwork
寂寞的船8 天前
【Unity Bug挑战】第12期 Awaitable 二次 await 死锁之谜 —— 为什么同一个异步操作等两次就卡死?
unity·c#·游戏引擎·bug
瓦瓦gogo8 天前
从一个 TypeScript 函数开始理解 MCP 协议
linux·ubuntu·typescript
鱼听禅8 天前
Ubuntu安装YOLOv8进行菌落识别训练
linux·python·yolo·ubuntu
Zucker n9 天前
文献发现、课题组织与证据可追溯的论文阅读。
论文阅读·windows·ubuntu
海拥✘9 天前
让 AI 修 AI 平台自己的 Bug:我用 SoduWork 给 SoduWork 提了一个 PR
人工智能·bug
Risehuxyc11 天前
fix bug
bug