天天看點

Jetson Nano配置IntelRealsense D435i(親測可用)

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
           

繼續閱讀