首页 » Ubuntu » Ubuntu14.04安装librealsense(camera R200)

Ubuntu14.04安装librealsense(camera R200)

原文 http://blog.csdn.net/github_38704428/article/details/79172559

2018-01-27 02:01:39阅读(403)

刚开始安装之前,查了很多资料。后来发现还是官网的文档最靠谱。

参考github上`/doc/installation.md`

注意:

现在github上librealsense的master branch是2.0版本的SDK,我的摄像头是R200,推荐安装的应该是1.0版本,在Legacy branch下面。这点需要额外注意,我就是因为没注意读说明,上来就装了mater branch下的2.0,结果打不开我的R200。提了个issue,才知道该装1.0


安装过程: 升级Ubuntu14.04的内核,要确保在4.4.50以上
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
对于有的低版本内核,上述三个命令不足以保证能将内核升级成功,接着运行:
sudo apt-get install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial
记住安装的内核的版本,我的是4.4.0-112-generic(在安装2.0版本的时候做过一遍这个步骤,当时升级到了4.4.0-111-generic)然后重启
sudo update-grub && sudo reboot
重启的时候选择高级选项,选4.4.0-112-generic那个启动项进入系统之后运行
uname -r
确认内核的版本
安装依赖项

sudo apt-get install libusb-1.0-0-dev pkg-config
下载legacy分支下的文件,并且解压进入解压后的文件夹目录。`~/Downloads/librealsense-legacy/`
./scripts/install_glfw3.sh
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include/GLFW
-- Installing: /usr/local/include/GLFW/glfw3.h
-- Installing: /usr/local/include/GLFW/glfw3native.h
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Config.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3ConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets.cmake
-- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake
-- Installing: /usr/local/lib/pkgconfig/glfw3.pc
-- Installing: /usr/local/lib/libglfw.so.3.2
-- Up-to-date: /usr/local/lib/libglfw.so.3
-- Up-to-date: /usr/local/lib/libglfw.so
Done installing glfw3!
上面的是安装glfw3的结果

编译和安装
mkdir build && cd build

cmake ../
cmake ../ -DBUILD_EXAMPLES=true
make && sudo make install
安装位置:库文件:/usr/local/lib 头文件:/usr/local/include demos, tutorials and tests :/usr/local/bin

安装V4L

sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger

sudo apt-get install libssl-dev
# 回到解压缩文件夹目录,运行下面的脚本
# 注意运行这个脚本的时候要拔掉摄像头
./scripts/patch-realsense-ubuntu-xenial.sh
script的运行结果:

Patched kernel module created successfully
Handle uvcvideo :
Module is resident, unloading ...  succeeded. 
Applying the patched module ...  succeeded
Script has completed successfully. Please consult the installation guide for further instruction.


运行下面的命令,检查上面脚本的运行结果

sudo dmesg | tail -n 50
结果如下:

[duyl@ ~/Downloads/librealsense-legacy]14:38$ sudo dmesg | tail -n 50
[ 2181.959700] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2189.735339] systemd-hostnamed[5791]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
[ 2286.338849] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2286.617633] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2286.617656] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2286.902883] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2287.181013] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2287.181019] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2436.613356] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2436.891560] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2436.891592] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2437.173328] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2437.451966] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2437.451989] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2636.552369] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2636.830929] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2636.830954] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2637.112289] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 2637.391121] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 2637.391144] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3003.917809] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3004.196396] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3004.196423] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3004.461784] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3004.740113] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3004.740132] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3095.311287] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3095.589577] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3095.589604] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3095.847286] usb 1-3.4: reset low-speed USB device number 6 using xhci_hcd
[ 3096.125293] usb 1-3.4: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3096.383295] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3096.661899] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3096.661926] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3158.971936] usbcore: deregistering interface driver uvcvideo
[ 3159.295591] media: Linux media interface: v0.10
[ 3159.305369] Linux video capture interface: v2.00
[ 3159.313350] uvcvideo: module verification failed: signature and/or required key missing - tainting kernel
[ 3159.313808] uvcvideo: Found UVC 1.00 device Integrated Webcam (1bcf:2c01)
[ 3159.321674] input: Integrated Webcam as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/input/input21
[ 3159.321970] usbcore: registered new interface driver uvcvideo
[ 3159.321976] USB Video Class driver (1.1.1)
[ 3211.504872] usb 1-3.4: reset low-speed USB device number 6 using xhci_hcd
[ 3211.783042] usb 1-3.4: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3216.913056] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3217.191717] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3217.191745] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3217.473159] usb 1-3.3: reset low-speed USB device number 4 using xhci_hcd
[ 3217.751717] usb 1-3.3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 3217.751741] usb 1-3.3: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[duyl@ ~/Downloads/librealsense-legacy]14:39$ 
注意倒数第几行显示的: usbcore: registered new interface driver uvcvideo



最新发布

CentOS专题

关于本站

5ibc.net旗下博客站精品博文小部分原创、大部分从互联网收集整理。尊重作者版权、传播精品博文,让更多编程爱好者知晓!

小提示

按 Ctrl+D 键,
把本文加入收藏夹