Ubuntu16.04安装intel RealSense D435i驱动并在ROS中使用

2023-05-16

参考:

  1. https://blog.csdn.net/qq_43265072/article/details/106437287
  2. https://blog.csdn.net/zhangfenger/article/details/84998082
  3. https://blog.csdn.net/sinat_23853639/article/details/88044019?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param

以下步骤基本是官方教程的翻译,更多细节请移步官方教程。

一、系统配置:

  1. 系统环境:Ubuntu16.04
  2. 内核版本:4.15.0-112-generic
    D435i 驱动支持的内核有: supported kernel version (4.[4,8,10,13,15,16]]),可通过:uname -r 查看内核版本

二、驱动安装:

以下采用source code方式进行安装
!!!注意:驱动安装过程中不要连接相机!!!

  1. Make Ubuntu Up-to-date::
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  1. Download/Clone librealsense github repository:
git clone https://github.com/IntelRealSense/librealsense.git
  1. Prepare Linux Backend and the Dev. Environment:
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev
  1. 进入 librealsense 根目录,运行 Intel Realsense permissions script :
./scripts/setup_udev_rules.sh
  1. Build and apply patched kernel modules for:
./scripts/patch-realsense-ubuntu-lts.sh

这里可能会遇到一些问题:
(1)g++需要升级,按照提示依次运行以下命令即可:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install g++-7 -y

(2)Applying the patched module … modprobe: ERROR: could not insert ‘videodev’: Required key not available
Failed to insert the patched module. Operation is aborted, the original module is restored
Verify that the current kernel version is aligned to the patched module version
在这里插入图片描述
出现此问题的原因是,Ubuntu Kernel 使用 EFI_SECURE_BOOT_SIG_ENFORCE 内核配置,这样会阻止内核载入第三方模块。解决方法如下:

  • 在终端输入:
sudo apt install mokutil
sudo mokutil --disable-validation
  • 执行后,终端会让你设置8-16位的密码(下一步要用,所以一定要记得设置的密码
  • 然后,重启电脑,会出现蓝屏,按下任意键进入选择界面 ,出现以下四个选项:
- Continue boot
- Change Secure Boot state
- Enroll key from disk
- Enroll hash from disk
  • 选择Change Secure Boot state,接下来会提示让你输入之前的密码。
    !!!注意:可能不是输入完整的密码(我的就不是),而是:Enter password character 3,意思是输入密码的第3位!!!(我是按照提示要求依次输入了密码的第3位、第6位和第1位,大家根据自己的实际情况操作)
  • 然后进入 Disable Secure Boot 选择界面,选择 yes,回车。
  • 接下来回到最开始的界面,选择reboot,重新进入系统。
  • 再次执行:./scripts/patch-realsense-ubuntu-lts.sh,成功。
    (此处也可参考:
    https://blog.csdn.net/m0_38066161/article/details/81812816
    https://askubuntu.com/questions/762254/why-do-i-get-required-key-not-available-when-install-3rd-party-kernel-modules)
  1. TM1-specific:
echo 'hid_sensor_custom' | sudo tee -a /etc/modules
  1. 编译librealsense2 SDK:
cd librealsense
mkdir build && cd build
cmake ..
# The default build is set to produce the core shared object and unit-tests binaries in Debug mode. Use -DCMAKE_BUILD_TYPE=Release to build with optimizations.

下面两个步骤可酌情跳过:

cmake ../ -DBUILD_EXAMPLES=true  # - Builds librealsense along with the demos and tutorials
cmake ../ -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=false # - For systems without OpenGL or X11 build only textual examples
  1. 重新编译和安装:
sudo make uninstall && make clean && make && sudo make install

说明:The shared object will be installed in /usr/local/lib, header files in /usr/local/include.
The binary demos, tutorials and test files will be copied into /usr/local/bin.

三、测试SDK:

连接相机,新开一个终端,输入:realsense-viewer 启动即可:
在这里插入图片描述
看到上图画面就说明连接啦!用户可以查看深度图、可视化点云、记录和回放视频,还可以配置摄像头设置、修改高级控件和后期处理等功能。

四、ROS包安装:

官方提供的RealSense ROS包安装有两种方式,一种是apt方式安装,另一种是源码安装。

1. apt安装:

  1. 安装 realsense2_camera and its dependents, including librealsense2 library:
sudo apt-get install ros-kinetic-realsense2-camera
  1. 安装 realsense2_description :
sudo apt-get install ros-kinetic-realsense2-description

It includes the 3D-models of the devices and is necessary for running launch files that include these models (i.e. roslaunch realsense2_camera rs_d435_camera_with_model.launch)

  1. start the camera node in ROS:
roslaunch realsense2_camera rs_camera.launch

显示如下界面:
在这里插入图片描述

  1. Start the camera node and make it publish the RGBD point cloud using aligned depth topic:
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud

2. 源码安装:

  1. 安装最新版本的Intel® RealSense™ SDK 2.0:
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main" -u
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
modinfo uvcvideo | grep "version:"
sudo apt-get update
sudo apt-get upgrade
  1. 源码方式安装Intel® RealSense™ ROS:
# Create a catkin workspace Ubuntu
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
# Clone the latest Intel® RealSense™ ROS from here into 'catkin_ws/src/'
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^\d+\.\d+\.\d+" | tail -1`
cd ..
# Make sure all dependent packages are installed. You can check .travis.yml file for reference.
# Specifically, make sure that the ros package ddynamic_reconfigure is installed.
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
  1. Start the camera node:
roslaunch realsense2_camera rs_camera.launch
  1. Start the camera node and make it publish the RGBD point cloud using aligned depth topic:
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
  1. Start the camera node and make it publish the aligned depth stream to other available streams such as color or infra-red:
roslaunch realsense2_camera rs_camera.launch align_depth:=true
  1. Set Camera Controls Using Dynamic Reconfigure Params:
rosrun rqt_reconfigure rqt_reconfigure

在这里插入图片描述

  1. realsense2_description package:
    For viewing included models, a separate package is included. For example:
roslaunch realsense2_description view_d415_model.launch
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu16.04安装intel RealSense D435i驱动并在ROS中使用 的相关文章

随机推荐

  • 2016晚安 2017你好

    不知不觉开通CSDN账号已有三年多的时间 xff0c 三年多以前抱着学习坚持的态度想要在CSDN上记录自己学习的点滴 结果三年多过去了 xff0c 2016年也随着过去了 xff0c 回顾2016年主要的三件事情就是 xff1a 1 从大学
  • Python入门学习--环境配置

    工作将近两年了 xff0c 做过B S结构的项目 xff0c 也做过android xff0c 也做过C S结构的项目 xff0c 相信无论是那种项目都是基于Java 学习运用Java也已经好多年了 xff0c 虽然也接触过C C 43 4
  • Python入门学习-数据类型

    一 类型的概念 首先 xff0c 对于一个数据1011100 xff0c 改怎么解释呢 xff1f 同Java等变成语言类型 xff0c 首先我们要明确数据的类型 xff0c 程序设计语言不允许语法歧义 xff0c 因此需要明确数据的类型
  • 流年似水 启航2019

    凌晨1点无意间看到一个演讲视频 感谢你给我机会上场 xff0c 很久之前的一个演讲视频 xff0c 看完除了羡慕还是羡慕吧 xff0c 也许就是一句话吧 xff0c 开挂的人生不需要解释 30多年的生活他做了很多事 xff0c 也做成了很多
  • Matplotlib 可视化必备神书,附pdf下载

    出品 xff1a Python数据之道 大家好 xff0c 我是阳哥 大家知道 xff0c 在利用Python进行数据可视化过程中 xff0c 基本上是很难绕开 Matplotlib 的 xff0c 因为 不少其他的可视化库多多少少是建立在
  • ubuntu学习笔记02

    1 sudo sh 与sudo bash sh区别 以超级用户身份运行 34 sh 34 xff0c sh实用程序是一个命令语言解释器 以超级用户身份运行 34 bash 34 xff0c Bash是shell或命令语言解释器 xff0c
  • 史上最浅显易懂的Git教程!

    从零起步的Git教程 xff0c 让你无痛苦上手世界上最流行的分布式版本控制系统Git xff01 既然号称史上最浅显易懂的Git教程 xff0c 那这个教程有什么让你怦然心动的特点呢 xff1f 首先 xff0c 本教程绝对面向初学者 x
  • 数据库死锁原因及解决办法

    死锁 xff08 Deadlock xff09 所谓死锁 xff1a 是指两个或两个以上的进程在执行过程中 xff0c 因争夺资源而造成的一种互相等待的现象 xff0c 若无外力作用 xff0c 它们都将无法推进下去 此时称系统处于死锁状态
  • spring和springmvc父子容器的关系

    大家都知道 xff0c 在spring的配置中要分开配置service层的注解扫描 xff0c 以及springmvc变现层的注解扫描 xff0c 如下 xff1a lt 扫描加载Service实现类 gt lt context compo
  • pageHelper分页插件实现原理及使用方法

    插件官方网站 xff1a https github com pagehelper Mybatis PageHelper tree master src main java com github pagehelper 实现原理 xff1a 使
  • 虚拟机Linux系统安装nginx服务器并启动的步骤

    工作前的准备 xff1a 1 装有Linux的虚拟机 2 nginx安装包 xff0c 注意是gz结尾的压缩文件 具体步骤1 xff1a 1 nginx安装环境 nginx是 C 语言开发 xff0c 建议在 linux 上运行 xff0c
  • 什么是反射机制,有什么作用

    1 反射机制定义 反射的概念是由Smith在1982年首次提出的 xff0c 主要是指程序可以访问 检测和修改其本身状态或行为的一种能力 在Java环境中 xff0c 反射机制允许程序在执行时获取某个类自身的定义信息 xff0c 例如熟悉和
  • 写给2016

    你不能期待着遇见怎样的自己 xff0c 但你可以选择成为怎样的自己 转眼16年就迎来了它的落幕 xff0c 不论怎样华丽的开场 xff0c 总有归于平静散场的结束 xff0c 不早不晚 xff0c 于清晨到傍晚 xff0c 于四季的轮回 x
  • 模块化建立项目流程(Maven聚合模块)

    先说项目使用Maven的好处 1 项目构建 Maven定义了软件开发的整套流程体系 xff0c 并进行了封装 xff0c 开发人员只需要指定项目的构建流程 xff0c 无需针对每个流程编写自己的构建脚本 2 依赖管理 除了项目构建 xff0
  • 如何在linux下判断web服务是否开启?

    对于web服务的开启的判断有以下几种常用方法 xff1a 1 端口查看 xff1a 本地 xff1a ss xff0c netstat xff0c lsof 1 2 3 4 5 6 7 8 9 10
  • git基本命令

    最近再写一些项目上传到github xff0c 所以要用到git命令 本地需要先安装git客户端 xff0c 然后指定一个git地址为本地仓库 然后右键git bash here打开git命令界面 首先服务端需要创建一个项目以便clone到
  • jps查看Java线程,jstack查看具体线程堆状态

    想要使用jps需要配置环境变量 xff0c 在classpath后在加一个指定Java bin目录 具体命令如下 t2挂起了 xff0c 堆里面显示t2为RUNNABLE xff0c suspend xff0c resume废弃使用 IBM
  • heap_1.c详解--------FreeRTOS内存管理

    heap 1源码分析 include lt stdlib h gt Defining MPU WRAPPERS INCLUDED FROM API FILE prevents task h from redefining all the A
  • 记录一个类加载变量引发的问题

    类加载变量导致的问题 类加载变量导致的问题 类加载变量导致的问题 因为项目需要 xff0c 银行要求使用weblogic部署并且启动所有项目 xff0c 不允许项目单独开服务启动一般都有这样的要求 xff0c 我所在的项目组有两个单独mai
  • Ubuntu16.04安装intel RealSense D435i驱动并在ROS中使用

    参考 xff1a https blog csdn net qq 43265072 article details 106437287https blog csdn net zhangfenger article details 849980