arm安装pyrealsense
– Step 1 –
conda install numba
pip install opencv-python
pip install scipy
– Step 2 pyrealsense2 –
参考 https://github.com/35selim/RealSense-Jetson 编译安装pyrealsense2
-
git clone -b v2.50.0 --depth=1 https://github.com/IntelRealSense/librealsense.git
-
cd librealsense && mkdir build && cd build
-
sudo apt-get -y install libssl-dev libxinerama-dev libxcursor-dev libcanberra-gtk-module libcanberra-gtk3-module
-
sed -i '3iset(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)\' ../CMakeLists.txt
-
下条命令记得改 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
-
sudo make -j$(($(nproc)-1)) && sudo make install
-
改路径,这个路径要找找pyrealsense2在哪里,下图是文件里的内容
echo 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/pyrealsense2' >> ~/.bashrc