realsense的安装问题


接手一位同事的realsense相关项目,先配置一个环境,出现不少问题,总结一下。以下操作基于ubuntu16.04

0. 旁白

我先在自己的旧系统上装,在执行sudo apt-get install librealsense2-utils命令的时候出现依赖不足,所以就补,结果就是1缺2,2缺4,无敌洞一样,然后试着重启了电脑,结果就黑屏了,各种修复失败。尚不明了问题出在哪里。这位哥们说是因为源的问题,我因为后面才看到他的帖子已无法证实。
后来就只能重装系统。

1. SDK的安装

SDK的安装方法从官网看有两种方法,直接安装或者从SDK手动编译。建议从SDK安装,官网教程

Register the server’s public key:
sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
In case the public key still cannot be retrieved, check and specify proxy settings: export http_proxy=“http://:”
, and rerun the command. See additional methods in the following link.
Add the server to the list of repositories:
Ubuntu 16 LTS:
sudo add-apt-repository “deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main” -u
Ubuntu 18 LTS:
sudo add-apt-repository “deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main” -u
Install the libraries (see section below if upgrading packages):
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils

The above two lines will deploy librealsense2 udev rules, build and activate kernel modules, runtime library and executable demos and tools.
Optionally install the developer and debug packages:
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg

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.

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
主要就是上面加粗的命令,最后可以用realsense-viewer来打开软件测试效果。

2. python开发包的安装

3. nodejs开发包的安装

安装有两种方法,一个是直接安装nodejs的开发包,另一种是安装完整的realsense开发包然后在里面直接安装。

方法1:

首先就是安装nvm,按照教程安装在了/usr/local/lib路径下,这个会导致后续在安装软件时的权限不足,哪怕是用sudo也无解,该问题官方给出了解决方案,还有简书
然后就是正常的安装realsense,官网教程,其中遇到:

  • 安装1
cd wrappers/nodejs
npm install
  • 测试
cd wrappers/nodejs/examples
npm install
node nodejs-capture.js

Q1:因为公司内部网络,需要代理,所以npm在使用时会提示失败或超时
A1:只要设置一下相关的代理就好了。

npm config set proxy=http://127.0.0.1:8087
npm config set registry=http://registry.npmjs.org

Q2:preinstall问题,可能是因为之前安装失败导致的残留。

A2:

sudo npm cache clean --force
sudo rm -rf node_modules
npm install --save node-librealsense
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章