Ubuntu18.04下Realsense D435 SDK安装

Ubuntu18.04下Realsense D435 SDK安装

这样装了很多次,都成功了,希望能帮到你们

  1. 更新
sudo apt-get update && sudo apt-get upgrade
  1. 直接gitclone,或者可以直接在https://github.com/IntelRealSense/librealsense选合适的版本,我的是2.50.0
git clone https://github.com/IntelRealSense/librealsense.git
  1. 确保相机拔出,不要连接在电脑上,运行下面的指令
sudo apt-get install git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev
  1. 根据自己的系统选择合适的
 * Ubuntu 14 or when running Ubuntu 16.04 live-disk:<br />
  ./scripts/install_glfw3.sh 

 * Ubuntu 16:<br />
  sudo apt-get install libglfw3-dev

 * Ubuntu 18:<br />
  sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev 
  1. librealsense目录打开终端,运行以下指令
./scripts/setup_udev_rules.sh

贴图太麻烦,直接copy结果如下:

j**@j**:~/Downloads/librealsense-2.50.0(1)/librealsense-2.50.0$ ./scripts/setup_udev_rules.sh 
Setting-up permissions for RealSense devices
[sudo] password for jcub: 
udev-rules successfully installed
# 在内核上打补丁包
./scripts/patch-realsense-ubuntu-lts.sh

结果如下:

j***@j***:~/Downloads/librealsense-2.50.0(1)/librealsense-2.50.0$ ./scripts/patch-realsense-ubuntu-lts.sh 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bc is already the newest version (1.07.1-2).
build-essential is already the newest version (12.4ubuntu1).
git is already the newest version (1:2.17.1-1ubuntu0.17).
linux-headers-generic is already the newest version (4.15.0.208.191).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Package required libusb-1.0-0-dev:  - found
Package required libssl-dev:  - found
Create patches workspace in ubuntu-bionic-hwe-5.4 folder

Package required libelf-dev:  - found
Package required elfutils:  - found
Package required bison:  - found
Package required flex:  - found
Fetching Ubuntu LTS tag Ubuntu-hwe-5.4-5.4.0-146.163_18.04.1  to the local kernel sources folder
remote: Counting objects: 1219683

remote: Total 7160417 (delta 6070796), reused 7112028 (delta 6023711)涨完,会很慢,2.50.0版本要涨到700多万吧,版本更高的话也更多。等这里完了之后,后面的步骤就很快了。可能会出现下面这个,没事

Package required flex:  - not found, installing now...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 libfl-dev libfl2
Suggested packages:
 flex-doc
...

然后就像下面这样:

Receiving objects: 100% (7160417/7160417), 1.51 GiB | 306.00 KiB/s, done.
Resolving deltas: 100% (6070796/6070796), done.
From git://kernel.ubuntu.com/ubuntu/ubuntu-bionic
* [new tag]                   Ubuntu-hwe-5.4-5.4.0-146.163_18.04.1 -> Ubuntu-hwe-5.4-5.4.0-146.163_18.04.1
Switching to LTS tag Ubuntu-hwe-5.4-5.4.0-146.163_18.04.1
Checking out files: 100% (66807/66807), done.
Note: checking out 'Ubuntu-hwe-5.4-5.4.0-146.163_18.04.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

 git checkout -b <new-branch-name>

HEAD is now at be458703c7dc UBUNTU: Ubuntu-hwe-5.4-5.4.0-146.163~18.04.1
Applying patches for bionic-hwe-5.4 line
Applying realsense-uvc patch
patching file drivers/media/usb/uvc/uvc_driver.c
Hunk #1 succeeded at 219 with fuzz 2 (offset 5 lines).
patching file drivers/media/usb/uvc/uvcvideo.h
Hunk #1 succeeded at 169 with fuzz 1 (offset 4 lines).
patching file drivers/media/v4l2-core/v4l2-ioctl.c
Hunk #1 succeeded at 1348 (offset 18 lines).
patching file include/uapi/linux/videodev2.h
Hunk #1 succeeded at 726 (offset -1 lines).
Applying realsense-metadata patch
patching file drivers/media/usb/uvc/uvc_driver.c
Hunk #1 succeeded at 2968 (offset 23 lines).
patching file drivers/media/usb/uvc/uvcvideo.h
Hunk #1 succeeded at 212 with fuzz 2 (offset 13 lines).
Applying realsense-hid patch
patching file drivers/iio/accel/hid-sensor-accel-3d.c
Hunk #1 succeeded at 279 (offset 3 lines).
patching file drivers/iio/gyro/hid-sensor-gyro-3d.c
Applying realsense-powerlinefrequency-fix patch
patching file drivers/media/usb/uvc/uvc_ctrl.c
Hunk #1 succeeded at 353 with fuzz 1 (offset -4 lines).
Increase UVC_URBs in uvcvideo
patching file drivers/media/usb/uvc/uvcvideo.h
Hunk #1 succeeded at 208 (offset 35 lines).
[sudo] password for j***:

输入密码就行了,最后是这样的:

..........
..........
 LD [M]  /home/j***/Downloads/librealsense-2.50.0/ubuntu-bionic-hwe-5.4/drivers/media/v4l2-core/v4l2-flash-led-class.ko
 LD [M]  /home/j***/Downloads/librealsense-2.50.0/ubuntu-bionic-hwe-5.4/drivers/media/v4l2-core/videobuf-dma-sg.ko
 LD [M]  /home/j***/Downloads/librealsense-2.50.0/ubuntu-bionic-hwe-5.4/drivers/media/v4l2-core/videobuf-core.ko
make: Leaving directory '/home/j***/Downloads/librealsense-2.50.0/ubuntu-bionic-hwe-5.4'
Patched kernels modules were created successfully

Replacing videodev  -
   Applying the patched module ...  succeeded
Replacing uvcvideo  -
   Applying the patched module ...  succeeded
Replacing hid_sensor_accel_3d  -
   Applying the patched module ...  succeeded
Replacing hid_sensor_gyro_3d  -
   Applying the patched module ...  succeeded

Script has completed. Please consult the installation guide for further instruction.
  1. 编译SDK,先在librealsense根目录下建立build,然后cmake,make
mkdir build && cd build
# DCMAKE_BUILD_TYPE=Release 是为了编译成release版本, -DBUILD_EXAMPLES=true是为了将示例编译进去
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
make -j4
sudo make install

7.之前照着网上的其他教程源码安装,试了很多次从来没成功过,我直接apt安装,反正我这是可以用的

sudo apt install ros-melodic-realsense2-camera
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值