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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章