1. 系统环境
- Jetson Nano
- Ubuntu 18.04(Jetson Nano的系统)
- IntelRealsense D435i
2. 下载jetsonhacksnano的安装脚本与Librealsense v2.31.0
2.1 下载jetsonhacksnano脚本
# 进入当前用户根目录,不在根目录安装就需要修改脚本Librealsense的安装位置
cd ~
# 克隆仓库到本地
git clone https://github.com/jetsonhacksnano/installLibrealsense
# 码云的镜像,github连不上用这个
git clone https://gitee.com/PPPPLeung/installLibrealsense.git
2.2 下载Librealsense v2.31.0源码
下载地址: https://github.com/IntelRealSense/librealsense/releases/tag/v2.31.0
在Assets选择下载Source code(tar.gz)
打不开github可以使用我gitee的备份
https://gitee.com/PPPPLeung/installLibrealsense/releases/release
2.3 开始安装
先安装依赖
cd installLibrealsense
./installLibrealsense.sh
修改buildLibrealsense.sh的部分参数为本地路径
#!/bin/bash
# Builds the Intel Realsense library librealsense on a Jetson Nano Development Kit
# Copyright (c) 2016-19 Jetsonhacks
# MIT License
# Jetson Nano; L4T 32.2.3
# 修改为你第二点下载的librealsense源码
LIBREALSENSE_DIRECTORY=${HOME}/librealsense-2.31.0
LIBREALSENSE_VERSION=v2.31.0
INSTALL_DIR=$PWD
# 修改为本地的cuda路径
NVCC_PATH=/usr/local/cuda-10.2/bin/nvcc
USE_CUDA=true
function usage
{
echo "usage: ./buildLibrealsense.sh [[-c ] | [-h]]"
echo "-nc | --build_with_cuda Build no CUDA (Defaults to with CUDA)"
echo "-h | --help This message"
}
修改后再执行脚本
./buildLibrealsense.sh
3. 使用IntelRealsense Viewer查看驱动是否安装成功
# terminal输入启动viewer
realsense-viewer
如果没检测出摄像头说明驱动有问题,或者Librealsense没有安装好
其他问题
1. 安装依赖
sudo apt-get install libcanberra-gtk-module libcanberra-gtk3-module
2. 使用buildLibrealsense.sh报错版本问题
将59~71行以下内容注释掉,不用检查版本
VERSION_TAG=$(git tag -l $LIBREALSENSE_VERSION)
if [ ! $VERSION_TAG ] ; then
echo ""
tput setaf 1
echo "==== librealsense Version Mismatch! ============="
tput sgr0
echo ""
echo "The installed version of librealsense is not current enough for these scripts."
echo "This script needs librealsense tag version: "$LIBREALSENSE_VERSION "but it is not available."
echo "Please upgrade librealsense or remove the librealsense folder before attempting to install again."
echo ""
exit 1
fi
3. 安装Swapfile
# 克隆仓库
git clone https://github.com/jetsonhacksnano/installSwapfile
# 安装
cd installSwapfile
./installSwapfile.sh
# 重启
reboot
4. pyrealsense2测试
该python3是编译了pyrealsense2的运行环境
python3 your_python_script.py