【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
相关推荐
I still …4 小时前
面向OS bug的TypeState分析
bug
让子弹飞0220 小时前
36.2Linux单总线驱动DS18B20实验(详细讲解代码)_csdn
linux·ubuntu·驱动的分离和分层
朱自清的诗.1 天前
使用虚拟机Ubuntu搭建mosquito服务器 使esp32、上位机通信
ubuntu·esp32·mosquito
虎头金猫1 天前
如何在Linux上使用Docker在本地部署开源PDF工具Stirling PDF:StirlingPDF+cpolar让专业操作像在线文档一样简单
linux·运维·ubuntu·docker·pdf·开源·centos
空灵之海1 天前
Ubuntu系统安全合规配置
linux·ubuntu·系统安全·1024程序员节
欢脱的小猴子1 天前
VUE3加载cesium,导入czml的星座后页面卡死BUG 修复
前端·vue.js·bug
笨鸟贤妃1 天前
Ubuntu 22.04 安装 Docker & Compose 最新最简单完整指南
ubuntu·docker·compose
leo__5201 天前
在Ubuntu 22.04系统中无需重启设置静态IP地址
tcp/ip·ubuntu·php
对你无可奈何1 天前
关于Ubuntu的 update造成的内核升级
运维·服务器·ubuntu
夜无霄1 天前
安卓逆向(一)Ubuntu环境配置
linux·运维·爬虫·ubuntu