arm安装pyrealsense

arm安装pyrealsense

– Step 1 –

conda install numba
pip install opencv-python
pip install scipy

– Step 2 pyrealsense2 –

很哟可能需要一点点magic
在这里插入图片描述

参考 https://github.com/35selim/RealSense-Jetson 编译安装pyrealsense2

  1. git clone -b v2.50.0 --depth=1 https://github.com/IntelRealSense/librealsense.git

  2. cd librealsense && mkdir build && cd build

  3. sudo apt-get -y install libssl-dev libxinerama-dev libxcursor-dev libcanberra-gtk-module libcanberra-gtk3-module

  4. 更新依赖库
    sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

    安装依赖库
    sudo apt-get install libudev-dev pkg-config libgtk-3-dev
    sudo apt-get install libusb-1.0-0-dev pkg-config
    sudo apt-get install libglfw3-dev
    sudo apt-get install libssl-dev

    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install cmake
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install pkg-config
    sudo apt-get install python-dev python-numpy
    sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev libpng-dev libtiff-dev
    sudo apt-get install -y libudev-dev

  5. sed -i '3iset(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)\' ../CMakeLists.txt

  6. 下条命令记得改 DPYTHON_EXECUTABLE 路径:

    cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DPYTHON_EXECUTABLE=[conda_path/envs/StairDetection/bin/python3] -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DBUILD_WITH_CUDA:bool=true


    上面那条命令可以加下面这三个参数,指定安装路径,否则的话,pyrealsense2会随机安装在某个系统python环境下

    -DPYTHON_EXECUTABLE=/home/cetc21/anaconda3/envs/elevation/bin/python -DPYTHON_INCLUDE_DIR=/home/cetc21/anaconda3/envs/elevation/include/python3.8 -DPYTHON_LIBRARY=/home/cetc21/anaconda3/envs/elevation/lib/libpython3.8.so


    sudo make uninstall && sudo make clean

  7. sudo make -j$(($(nproc)-1)) && sudo make install

  8. 改路径,这个路径要找找pyrealsense2在哪里,下图是文件里的内容

    echo 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/pyrealsense2' >> ~/.bashrc

    arm安装pyrealsense_第1张图片

你可能感兴趣的:(Arm端部署,python,开发语言)