Jetson Nano: Install librealsense with Python bindings

  1. Download librealsense source as .zip: https://github.com/IntelRealSense/librealsense/releases/
  2. After downloading the zip file, its contents should be extracted so that you have a librealsense folder
  3. cd to the librealsense root directory
mkdir build && cd build

5.

cmake ../ -DFORCE_RSUSB_BACKEND=ON -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3

6.

make -j4

7.

sudo make install

8. update your PYTHONPATH environment variable to add the path to the pyrealsense library. The folder should contain some files calles similar to „pyrealsense2.cpython-something.so“ and „pybackend2.cpython-something.so“. If your user is „jetson“ and you unzipped the source of v 2.39.0 to your Desktop, the path might be something like here:

export PYTHONPATH=$PYTHONPATH:/home/jetson/Desktop/librealsense-2.39.0/build/wrappers/python

9. Add the export statement of step 8 to the end of your .bashrc so the python bindings are available automatically.

sudo nano .bashrc

Save with Ctrl+O

10.Check whether realsense-viewer works:

realsense-viewer

11. Check whether the python bindings are available

python3

>>> import pyrealsense2 as rs

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert