【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
相关推荐
xiaobin889995 小时前
【2025最新版】VMware虚拟机下载安装教程 保姆级图文详解(附安装包+常用镜像Linux,win11,ubuntu,centos)
linux·其他·ubuntu·centos
ALex_zry5 小时前
Ubuntu 20.04 C++开发环境搭建指南(2025版)
linux·c++·ubuntu
Eric.Lee202119 小时前
Ubuntu shell指定conda的python环境启动脚本
python·ubuntu·conda·shell
dubochao_xinxi1 天前
✅ TensorRT Python 安装精简流程(适用于 Ubuntu 20.04+)
开发语言·python·ubuntu
yangshuo12811 天前
风车OVF镜像:解放AI开发限制的Ubuntu精简系统
linux·人工智能·ubuntu
flypig哗啦啦1 天前
ubuntu服务器版启动卡在start job is running for wait for...to be Configured
linux·运维·ubuntu
子非衣1 天前
Ubuntu系统挂载磁盘并配置开机自动挂载
linux·运维·ubuntu
ChironW1 天前
Ubuntu 22.04.5 LTS上部署Docker及相关优化
ubuntu·docker·容器
richer_20201 天前
双系统重装ubuntu
linux·运维·ubuntu
微学AI1 天前
用FileCodeBox打造私有文件传输:Ubuntu环境保姆级部署教程!
linux·运维·ubuntu