【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
相关推荐
Mr. Cao code1 天前
Dockerfile 指令详解与实战指南
linux·运维·ubuntu·docker·容器
DrugOne1 天前
GAMESS 在 Ubuntu 24.04 平台上的编译与配置
linux·python·ubuntu·drugone
Crazy_diamonds1 天前
ubuntu下桌面应用启动图标的内容文件
linux·ubuntu·intellij-idea
想学全栈的菜鸟阿董1 天前
Ubuntu Linux 入门指南
linux·运维·ubuntu
洛克大航海1 天前
Ubuntu安装JDK与Maven和IntelliJ IDEA
ubuntu·jdk·maven·intellij idea
~光~~2 天前
【环境配置 】WSL2 +ubuntu20.04 +Qt配置+Kits配置
开发语言·qt·ubuntu
洛阳纸贵Coco.Leo.YI2 天前
10分钟在Windows11下Ubuntu内安装docker-Version28.51
linux·ubuntu·docker
阿巴~阿巴~2 天前
Ubuntu 20.04 安装 Redis
linux·服务器·数据库·redis·ubuntu
海底列车2 天前
ubuntu-20.04.6升级OpenSSH_10.2p1
linux·服务器·ubuntu
陳錄生2 天前
ubuntu 24.10安装MongoDB
linux·mongodb·ubuntu