librealsense2及pyrealsense2安装

librealsense2及pyrealsense2安装

环境:重新安装的Ubuntu16.04,什么都没有 emmmmm

1.安装包

官方文档:https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md

(1)sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE

(2)sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main" -u

(3)sudo apt-get install librealsense2-dkms

(4)sudo apt-get install librealsense2-utils

2.安装pyrealsense2

(1)下载pyrealsense2

pip install pyrealsense2 -i https://pypi.tuna.tsinghua.edu.cn/simple (这里使用了清华源,几秒钟就下载下了)

3.下载及编译安装librealsense-master

下载链接:https://github.com/IntelRealSense/librealsense

安装文档:https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/readme.md

(1)安装依赖

sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev 

sudo apt-get install libglfw3-dev

提示缺啥补啥,后面cmake报错就是这步缺东西

(2)将下载的librealsense-master解压(用命令行或者手动都可以),然后进入此目录下,开始编译

mkdir build
cd build
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true
make -j4   #-j4取决于自己的电脑,我的跑-j10没问题
sudo make install

(3)配置使用librealsense的python路径

export PYTHONPATH=$PYTHONPATH:/usr/local/lib

然后大功告成

注意:你的python程序根目录下不能有pyrealsense2.py的同名文件,本人由于这一骚操作白白重装了若干次emmmm…

你可能感兴趣的:(学习笔记,librealsense,pyrealsense,安装笔记)