参考github上的SDK安装思路,在此做一下备份。
安装librealsense
- Build and Patch Kernel Modules for Jetson L4T
- Navigate to the root of libreansense2 directory.
- Run the script (note the ending characters - L4T)
./scripts/patch-realsense-ubuntu-L4T.sh
- Build librealsense2 SDK
-
Navigate to the SDK’s root directory
-
Follow the Ubuntu installation guide to install the missing components and configuration items:
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_EXAMPLES=true -DCMAKE_BUILD_TYPE=release -DFORCE_RSUSB_BACKEND=false -DBUILD_WITH_CUDA=true && make -j$(($(nproc)-1)) && sudo make install
安装SDK对应版本的ros参考官网即可。
绕过ros,直接使用opencv调用librealsense,启动相机
- 设置RGB和深度图的参数:
cfg.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_BGR8, 60);
cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 60);
- 设置曝光度: