树莓派4配置RealSense with Python Wrapper

准备阶段

使用镜像:2021-05-07-raspios-buster-armhf

扩大文件系统 Advance - Expand

sudo raspi-config

参考:https://github.com/acrobotic/Ai_Demos_RPi/wiki/Raspberry-Pi-4-and-Intel-RealSense-D435

sudo apt update
sudo apt upgrade -y
sudo apt install automake libtool vim cmake \
  libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-dev
sudo apt install libssl-dev libgl1-mesa-glx

设置SWAP从100为2048(2G)

sudo vim /etc/dphys-swapfile
sudo /etc/init.d/dphys-swapfile restart swapon -s

源码阶段

创建代码目录

mkdir -p ~/liujl && cd ~/liujl
git clone https://github.com/IntelRealSense/librealsense.git --depth=1

配置usb摄像头

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

或者:

cd librealsense
sudo ./scripts/setup_udev_rules.sh

开始编译

选项说明:https://dev.intelrealsense.com/docs/build-configuration

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_EXAMPLES=true \
  -DFORCE_RSUSB_BACKEND=ON \
  -DBUILD_PYTHON_BINDINGS=bool:true\
  -DPYTHON_EXECUTABLE=$(which python3)
make
sudo make install
上一篇:Python编程技巧(三)—— 装饰器


下一篇:(精读spring-framework-v5.3.5)环境搭建