配置完成后可以参考RealSense D435i同时传输视频深度流、RGB流、IR流和惯性单元IMU流(Python),获取RealSense数据流
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
安装了 librealsense2-dev 包后,可以使用
g++ -std = c++ 11 filename.cpp-lrealsense2
或选择的 IDE 编译具有 librealsense 的应用程序。要使用CMake开始 RealSense,请查看 librealsense/examples/CMake
realsense-viewer
终端输入:ldd /usr/bin/realsense-viewer | grep libusb
显示:libusb-1.0.so.0 => /usr/local/lib/aarch64-linux-gnu/libusb-1.0.so.0 (0x0000007f9023d000)
移除对应文件:sudo rm /usr/local/lib/aarch64-linux-gnu/libusb-1.0.so.0
重新安装libsub-dev:sudo apt-get install libusb-dev
官方文档
前提条件
MAXN
构建和补充Jetson L4T内核模块
构建librealsense2 SDK
make 带有python包的librealsense2
sudo apt-get install git libssl-dev libusb-1.0-0-dev libudev-dev pkg-config libgtk-3-dev -y
./scripts/setup_udev_rules.sh
mkdir build && cd build
cmake .. -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=release -DFORCE_RSUSB_BACKEND=false -DBUILD_WITH_CUDA=false && make -j4 && sudo make install
添加环境变量
export PYTHONPATH=$PYTHONPATH:/usr/local/lib:/usr/local/lib/python3.6/pyrealsense2
完成编译安装之后,可在/usr/local/lib/python3.6/pyrealsense2/目录下查看编译好的库文件
pybackend2.cpython-36m-aarch64-linux-gnu.so
pybackend2.cpython-36m-aarch64-linux-gnu.so.2.50.0
pyrealsense2.cpython-36m-aarch64-linux-gnu.so.2.50
pybackend2.cpython-36m-aarch64-linux-gnu.so.2
pyrealsense2.cpython-36m-aarch64-linux-gnu.so
pyrealsense2.cpython-36m-aarch64-linux-gnu.so.2.50.0
执行下面命令,初始化python环境
#更新软件源
sudo apt-get update
sudo apt-get upgrade
#安装python3和pip3
sudo apt-get install python3-dev
sudo apt-get install python3-pip
pip3 install --upgrade pip
#换源
mkdir ~/.pip
vim ~/.pip/pip.conf
#添加下面内容,清华镜像源
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
安装软件包
#查看已有的包
pip3 list
#如果没有需要的包,通过下面命令安装
pip3 install numpy
pip3 install opencv-contrib-python