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开发包的安装

自行参考官方

另:安装python3.6的时候,把默认python3的链接删除改为链接到3.6的方法,会使得ctrl+alt+T快捷键和software & update中心闪退打不开。
一个方法是版本切换工具,把默认python改为3.6版本,另一个方法网站打开看看。

3. nodejs开发包的安装

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

方法1:

realsense完整包:

git clone xxx

install教程https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md#building-librealsense2-sdk

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

方法2:

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

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
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值