【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
相关推荐
雷工笔记2 小时前
Ubuntu迁移记录
笔记·ubuntu
Liu.7743 小时前
uni-app 组件 uni-easyinput 常见 Bug 及解决方案
uni-app·bug
一叶龙洲3 小时前
ubuntu26.04 xfce美化成mac
服务器·ubuntu·macos
一叶龙洲15 小时前
wslg打开Ubuntu24.04默认打开图形界面
linux·服务器·数据库·ubuntu
敖行客 Allthinker17 小时前
Parallels Ubuntu虚拟机项目如何让手机访问?完整解决方案
linux·运维·ubuntu
keyipatience18 小时前
线程栈与TLS和线程互斥
java·linux·服务器·开发语言·ubuntu
观山岳五楼19 小时前
Ubuntu 24 怎么使用Ubuntu 20 的镜像源
linux·运维·ubuntu
辰痕~20 小时前
物理机装Linux操作系统(Ubuntu为例)
linux·ubuntu
Byron Loong1 天前
【Git】如何检查 Ubuntu 系统上 gitLab 是否开启
git·ubuntu·gitlab
一叶龙洲2 天前
win11与Ubuntu之间同步配置、插件
linux·运维·ubuntu