Ubuntu源码安装librealsense

1.下载librealsense
https://github.com/IntelRealSense/librealsense/releases/tag/v2.16.5
2.sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libglfw3-dev

3.sudo apt-get install libgtk-3-dev
报错:

The following packages have unmet dependencies:
 libgtk-3-dev : Depends: libgtk-3-0 (= 3.18.9-1ubuntu3) but 3.18.9-1ubuntu3.3 is to be installed

解决方法:
1)在Software Sources中修改配置:
勾选Important security updates (lucid-security)和Recommended updates (lucid-updates)选项
2)执行update操作

sudo apt-get update

3)重新安装:

sudo apt-get install libgtk-3-dev

4.在 librealsense 文件夹下安装Video4Linux视频内核驱动,注意不要插上摄像头。
构建和应用修补内核模块:

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
./scripts/patch-realsense-ubuntu-lts.sh

Error when execute ./scripts/patch-realsense-ubuntu-lts.sh

Error Description:
Patched kernels modules were created successfully
Replacing videodev :
	Module videodev  is used by videobuf2_core
	Unloading dependency videobuf2_core
	modprobe: FATAL: Module videobuf2_core is in use.
Failed to unload module videobuf2_core. error type 1 . Operation is aborted

Solution:

lsmod | grep videobuf2_core
sudo modprobe -r uvcvideo
lsmod | grep videobuf2_core
./scripts/patch-realsense-ubuntu-lts.sh

提示完成后,插上RealSense,可执行sudo dmesg | tail -n 50查看结果。

5.编译安装

mkdir build && cd build
cmake ../ -DBUILD_EXAMPLES=true
sudo make uninstall && make clean && make -j8 && sudo make install

6.install完成后,目标文件在 /usr/local/bin中。
进入librealsense/build/examples/capture,输入rs-capture测试。

参考自:
https://blog.csdn.net/taiyangwangzi/article/details/89195714
http://www.pianshen.com/article/6519141340/
https://blog.csdn.net/qq_33419535/article/details/88547498
https://blog.csdn.net/qq_42393859/article/details/85257685
https://blog.csdn.net/riancy_riancy/article/details/83270836
https://blog.csdn.net/weixin_39585934/article/details/83902811
https://www.jianshu.com/p/51fca21bf6f4
https://www.jianshu.com/p/68e690d108f8

你可能感兴趣的:(RealSense)