当前位置:   article > 正文

ubuntu 16.04 安装realsense sdk 2_ubuntu16.04安装最新版intel realsense sdk 2.0

ubuntu16.04安装最新版intel realsense sdk 2.0

ubuntu 16.04 安装realsense sdk 2


一、官方测试教程

官方安装教程网址
官方步骤:
1、Register the server’s public key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE 
  • 1

In case the public key still cannot be retrieved, check and specify proxy settings:

export http_proxy="http://<proxy>:<port>"
  • 1

, and rerun the command. See additional methods in the following link.

2、Add the server to the list of repositories:

sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
  • 1
  • 2

The above two lines will deploy librealsense2 udev rules, build and activate kernel modules, runtime library and executable demos and tools.

3、Optionally install the developer and debug packages:

sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
  • 1
  • 2

With dev package installed, you can compile an application with librealsense using g++ -std=c++11 filename.cpp -lrealsense2 or an IDE of your choice.

4、测试安装结果,连上相机,输入 realsense-viewer
Reconnect the Intel RealSense depth camera and run: realsense-viewer to verify the installation.
Verify that the kernel is updated :
modinfo uvcvideo | grep “version:” should include realsense string

5、关于卸载
Uninstalling the Packages:

Important Removing Debian package is allowed only when no other installed packages directly refer to it. For example removing librealsense2-udev-rules requires librealsense2 to be removed first.

Remove a single package with:

sudo apt-get purge <package-name>
  • 1

Remove all RealSense™ SDK-related packages with:

dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge
  • 1

二、源码安装

1.下载安装CMake

CMake和gcc,我的环境里面以前已经安装过
参考:
https://blog.csdn.net/qq_42393859/article/details/85257685?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_title~default-0.no_search_link&spm=1001.2101.3001.4242.1

https://blog.csdn.net/weixin_44024460/article/details/89320469
https://www.freesion.com/article/265616043/
1)下载cmake-3.8.2.tar.gz : https://cmake.org/files/
or https://blog.csdn.net/qq_42393859/article/details/85251356

2)在主文件夹下新建tools/文件夹,将cmake-3.8.2.tar.gz解压之后放在tools/中,为了防止出现权限不足问题,直接对文件更改权限:

解压:sudo tar -zxvf cmake-3.8.2.tar.gz
赋权限:sudo chmod -R 777 cmake-3.8.2
  • 1
  • 2

2.安装gcc

安装gcc-c++:

sudo apt-get install build-essential
或者直接执行这两条命令

sudo apt-get install gcc
sudo apt-get install g++
  • 1
  • 2
  • 3
  • 4
  • 5

进入文件夹下执行以下命令:

 sudo ./bootstrap
 sudo make
 sudo make install
  • 1
  • 2
  • 3

查看是否安装成功以及安装版本:

cmake --version
  • 1

3.下载源码

git clone https://github.com/IntelRealSense/librealsense.git
或官网的其他版本:https://github.com/IntelRealSense/librealsense/releases
  • 1
  • 2

配置开发环境:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev
  • 1
  • 2
  • 3

设置usb设备规则,进入下载的realsense sdk主目录,执行命令:

./scripts/setup_udev_rules.sh
  • 1

Build and apply patched kernel modules for: * Ubuntu 14/16/18/20 with LTS kernel(drivers)

./scripts/patch-realsense-ubuntu-lts.sh
  • 1

(连接好多文件,有点慢。)

进入下载的realsense sdk主目录,源码编译安装:

mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
sudo make uninstall && make clean && make -j8 && sudo make install
  • 1
  • 2
  • 3
  • 4

参考链接:
https://www.freesion.com/article/5704459572/
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md

如果想安装python realsense , 直接pyrealsense2的安装即可
https://blog.csdn.net/qq_42393859/article/details/85044330

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/59652
推荐阅读
相关标签
  

闽ICP备14008679号