上海设计网站方法盐城工程造价信息网
2026/3/3 19:34:27 网站建设 项目流程
上海设计网站方法,盐城工程造价信息网,wordpress小说文章发布软件,查看域名注册信息一般是默认安装的 pyrealsense2 版本太新#xff0c;移除了对t265的支持。 需要换装 旧版的包#xff0c;如 v2.51.1 版本的 librealsense 驱动库 可以正常使用。安装过程 #0#xff09;获取 v2.51.1 版本的 librealsense 驱动库(必须) mkdir ~/my -p cd my 移除了对t265的支持。需要换装 旧版的包如 v2.51.1 版本的 librealsense 驱动库 可以正常使用。安装过程#0获取 v2.51.1 版本的 librealsense 驱动库(必须)mkdir~/my -pcdmypwdgitclone -b v2.51.1 https://github.com/IntelRealSense/librealsense.git# 这里放在了 orangepi的 ~/my/librealsense-R-251/ 这里已经编译并安装好了剩下步骤可做参考。#1安装依赖包sudoapt-getinstalllibudev-dev pkg-config libgtk-3-dev -ysudoapt-getinstalllibusb-1.0-0-dev pkg-config -ysudoapt-getinstalllibglfw3-dev -ysudoapt-getinstalllibssl-dev -y# 出错时更新源sudo apt-get update --fix-missing#2安装权限脚本/ 安装规则文件cdlibrealsensesudocpconfig/99-realsense-libusb.rules /etc/udev/rules.d/sudoudevadm control --reload-rulessudoudevadm trigger#3编译mkdirbuildcdbuild cmake../ -DBUILD_EXAMPLEStrue -DBUILD_PYTHON_BINDINGS:booltrue -DPYTHON_EXECUTABLE$(whichpython3)makemake-j8sudomakeinstall# 遇到 clone third packages timeout , 请手动下载 相关库包的指定版本修改 librealsense/CMake/external_libxxxxx.cmake 改为本地安装# 比如# external_libcurl 修改 GIT_REPOSITORY https://github.com/curl/curl.git 为 URL /home/orangepi/my/librealsense-R-251/curl.zip 必须是下面指定的git tag版本的包# 将 特殊的python 动态库包加入 环境变量避免python找不到包/import失败。echoexport PYTHONPATH/usr/lib/python3/dist-packages/pyrealsense2:$PYTHONPATH~/.bashrc#4使用t265驱动查看摄像头数据realsense-viewer#5)卸载#dpkg -l | grep realsense | cut -d -f 3 | xargs sudo dpkg --purg#————————————————#版权声明本文为CSDN博主「YOULANSHENGMENG」的原创文章遵循CC 4.0 BY-SA版权协议转载请附上原文出处链接及本声明。#原文链接https://blog.csdn.net/YOULANSHENGMENG/article/details/129358380留意一下安装日志这里python的pyrealsense2库包是默认安装在了/usr/lib/python3.8/site-packages/pyrealsense2。安装日志: orangepiorangepi5b:~/my/librealsense-R-251/build$sudomakeinstall[sudo]passwordfororangepi: -- Checking internet connection... -- Internet connection identified -- Info:REALSENSE_VERSION_STRING2.51.1 -- Setting Unix configurations -- Building libcurl enabled -- using RS2_USE_V4L2_BACKEND -- Configuringdone-- Generatingdone-- Build files have been written to: /home/orangepi/my/librealsense-R-251/build/external-projects/pybind11 make[1]: Entering directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11make[2]: Entering directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11make[3]: Entering directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11make[3]: Leaving directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11make[3]: Entering directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11[12%]Performing update stepforpybind11[25%]No configure stepforpybind11[37%]No build stepforpybind11[50%]Noinstallstepforpybind11[62%]Completedpybind11make[3]: Leaving directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11[100%]Built target pybind11 make[2]: Leaving directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11make[1]: Leaving directory/home/orangepi/my/librealsense-R-251/build/external-projects/pybind11-- pybind11 v2.6.2 -- Building with TM2 -- Fetching recommended firmwares: -- D4XX_FW_VERSION:5.13.0.50 -- SR3XX_FW_VERSION:3.26.1.0 -- T26X_FW_VERSION:0.2.0.951 -- L51X_FW_VERSION:1.5.8.1 -- L53X_FW_VERSION:3.5.5.1 -- https://librealsense.intel.com/Releases/RS4xx/FW/D4XX_FW_Image-5.13.0.50.bin -- Download firmware0;returning early; file already exists with expected SHA1 hashforD4XX_FW_Image-5.13.0.50.bin -- https://librealsense.intel.com/Releases/SR300/FW/SR3XX_FW_Image-3.26.1.0.bin -- Download firmware0;returning early; file already exists with expected SHA1 hashforSR3XX_FW_Image-3.26.1.0.bin -- https://librealsense.intel.com/Releases/TM2/FW/target/0.2.0.951/target-0.2.0.951.mvcmd -- Download firmware0;returning early; file already exists with expected SHA1 hashfortarget-0.2.0.951.mvcmd -- https://librealsense.intel.com/Releases/L5xx/FW/L51X_FW_Image-1.5.8.1.bin -- Download firmware0;returning early; file already exists with expected SHA1 hashforL51X_FW_Image-1.5.8.1.bin -- https://librealsense.intel.com/Releases/L5xx/FW/L53X_FW_Image-3.5.5.1.bin -- Download firmware0;returning early; file already exists with expected SHA1 hashforL53X_FW_Image-3.5.5.1.bin -- Configuringdone-- Generatingdone-- Build files have been written to: /home/orangepi/my/librealsense-R-251/build[3%]Built target fw[13%]Built target realsense-file[71%]Built target realsense2[75%]Built target libcurl[84%]Built target pybackend2[91%]Built target pyrealsense2[93%]Built target rs-convert[93%]Built target rs-enumerate-devices[94%]Built target rs-fw-logger[96%]Built target rs-terminal[97%]Built target rs-record[98%]Built target rs-fw-update[100%]Built target rs-embed Install the project... -- Install configuration:-- Installing: /usr/local/lib/librealsense2.so.2.51.1 -- Installing: /usr/local/lib/librealsense2.so.2.51 -- Installing: /usr/local/lib/librealsense2.so -- Installing: /usr/local/include/librealsense2 -- Installing: /usr/local/include/librealsense2/h -- Installing: /usr/local/include/librealsense2/h/rs_types.h -- Installing: /usr/local/include/librealsense2/h/rs_sensor.h -- Installing: /usr/local/include/librealsense2/h/rs_record_playback.h -- Installing: /usr/local/include/librealsense2/h/rs_config.h -- Installing: /usr/local/include/librealsense2/h/rs_advanced_mode_command.h -- Installing: /usr/local/include/librealsense2/h/rs_pipeline.h -- Installing: /usr/local/include/librealsense2/h/rs_frame.h -- Installing: /usr/local/include/librealsense2/h/rs_option.h -- Installing: /usr/local/include/librealsense2/h/rs_processing.h -- Installing: /usr/local/include/librealsense2/h/rs_device.h -- Installing: /usr/local/include/librealsense2/h/rs_context.h -- Installing: /usr/local/include/librealsense2/h/rs_internal.h -- Installing: /usr/local/include/librealsense2/rsutil.h -- Installing: /usr/local/include/librealsense2/utilities -- Installing: /usr/local/include/librealsense2/utilities/concurrency -- Installing: /usr/local/include/librealsense2/utilities/concurrency/dispatcher.cpp -- Installing: /usr/local/include/librealsense2/utilities/concurrency/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/concurrency/concurrency.h -- Installing: /usr/local/include/librealsense2/utilities/time -- Installing: /usr/local/include/librealsense2/utilities/time/periodic-timer.h -- Installing: /usr/local/include/librealsense2/utilities/time/common.h -- Installing: /usr/local/include/librealsense2/utilities/time/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/time/work-week.h -- Installing: /usr/local/include/librealsense2/utilities/time/stopwatch.h -- Installing: /usr/local/include/librealsense2/utilities/time/work-week.cpp -- Installing: /usr/local/include/librealsense2/utilities/time/timer.h -- Installing: /usr/local/include/librealsense2/utilities/time/waiting-on.h -- Installing: /usr/local/include/librealsense2/utilities/number -- Installing: /usr/local/include/librealsense2/utilities/number/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/number/stabilized-value.h -- Installing: /usr/local/include/librealsense2/utilities/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/os -- Installing: /usr/local/include/librealsense2/utilities/os/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/os/hresult.h -- Installing: /usr/local/include/librealsense2/utilities/string -- Installing: /usr/local/include/librealsense2/utilities/string/windows.h -- Installing: /usr/local/include/librealsense2/utilities/string/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/string/split.h -- Installing: /usr/local/include/librealsense2/utilities/string/trim-newlines.h -- Installing: /usr/local/include/librealsense2/utilities/string/string-utilities.h -- Installing: /usr/local/include/librealsense2/utilities/easylogging -- Installing: /usr/local/include/librealsense2/utilities/easylogging/CMakeLists.txt -- Installing: /usr/local/include/librealsense2/utilities/easylogging/shared-init.cpp -- Installing: /usr/local/include/librealsense2/utilities/easylogging/easyloggingpp.cmake -- Installing: /usr/local/include/librealsense2/utilities/easylogging/easyloggingpp.h -- Installing: /usr/local/include/librealsense2/rs.hpp -- Installing: /usr/local/include/librealsense2/rs_advanced_mode.hpp -- Installing: /usr/local/include/librealsense2/rs_advanced_mode.h -- Installing: /usr/local/include/librealsense2/rs.h -- Installing: /usr/local/include/librealsense2/hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_sensor.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_types.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_serializable_device.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_frame.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_record_playback.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_context.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_device.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_options.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_processing.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_export.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_pipeline.hpp -- Installing: /usr/local/include/librealsense2/hpp/rs_internal.hpp -- Installing: /usr/local/lib/cmake/realsense2/realsense2Targets.cmake -- Installing: /usr/local/lib/cmake/realsense2/realsense2Targets-noconfig.cmake -- Installing: /usr/local/lib/cmake/realsense2/realsense2Config.cmake -- Installing: /usr/local/lib/cmake/realsense2/realsense2ConfigVersion.cmake -- Installing: /usr/local/lib/pkgconfig/realsense2.pc -- Installing: /usr/local/lib/librealsense-file.a -- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so.2.51.1 -- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so.2 -- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pybackend2.cpython-38-aarch64-linux-gnu.so -- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.51.1 -- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.51 -- Set runtime path of/usr/lib/python3/dist-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so.2.51.1to-- Installing: /usr/lib/python3/dist-packages/pyrealsense2/pyrealsense2.cpython-38-aarch64-linux-gnu.so -- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Targets.cmake -- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Targets-noconfig.cmake -- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2Config.cmake -- Installing: /usr/local/lib/cmake/pyrealsense2/pyrealsense2ConfigVersion.cmake -- Installing: /usr/local/bin/rs-convert -- Set runtime path of/usr/local/bin/rs-convertto-- Installing: /usr/local/bin/rs-enumerate-devices -- Set runtime path of/usr/local/bin/rs-enumerate-devicesto-- Installing: /usr/local/bin/rs-fw-logger -- Set runtime path of/usr/local/bin/rs-fw-loggerto-- Installing: /usr/local/bin/rs-terminal -- Set runtime path of/usr/local/bin/rs-terminalto-- Installing: /usr/local/bin/rs-record -- Set runtime path of/usr/local/bin/rs-recordto-- Installing: /usr/local/bin/rs-fw-update -- Set runtime path of/usr/local/bin/rs-fw-updateto-- Installing: /usr/local/bin/rs-embed -- Installing: /usr/local/lib/libfw.a现在使用的是 pyrealsense2 v2.51.1在此路径下执行export PYTHONPATH/usr/lib/python3/dist-packages/pyrealsense2:$PYTHONPATH python3 -c import pyrealsense2 as rs; print(rs.__version__)应该可以正常输出 v2.51.1表明t265驱动包编译安装正常。解决错误python3中 import pyrealsense2失败echo export PYTHONPATH/usr/lib/python3/dist-packages/pyrealsense2:$PYTHONPATH ~/.bashrc安装之后的实验现象由于udev规则重新加载了如果读不到t265数据请重新插拔一次t265接口让机器识别到。任意终端执行可以观察到如下界面弹出realsense-viewer3D数据图2D数据图python3读取t265传感器数据 参考示例上述过程已经将 c/python的驱动库 编译并安装好了现在需要我们测试编程读取t265传感器数据。https://zhuanlan.zhihu.com/p/441905002 参考此博客指导可以在之前git clone好的https://github.com/IntelRealSense/librealsense.git 下面找到python示例程序位置librealsense/wrappers/python/examples/获得姿态/加速度信息#!/usr/bin/python# -*- coding: utf-8 -*-## License: Apache 2.0. See LICENSE file in root directory.## Copyright(c) 2019 Intel Corporation. All Rights Reserved.​####################################################### librealsense T265 example #######################################################​# First import the libraryimportpyrealsense2asrs ​# Declare RealSense pipeline, encapsulating the actual device and sensorspipers.pipeline()​# Build config object and request pose datacfgrs.config()cfg.enable_stream(rs.stream.pose)​# Start streaming with requested configpipe.start(cfg)​try:for_inrange(50):# Wait for the next set of frames from the cameraframespipe.wait_for_frames()​# Fetch pose frameposeframes.get_pose_frame()ifpose:# Print some of the pose data to the terminaldatapose.get_pose_data()print(Frame #{}.format(pose.frame_number))print(Position: {}.format(data.translation))print(Velocity: {}.format(data.velocity))print(Acceleration: {}\n.format(data.acceleration))​finally:pipe.stop()获得位置信息#!/usr/bin/python# -*- coding: utf-8 -*-## License: Apache 2.0. See LICENSE file in root directory.## Copyright(c) 2019 Intel Corporation. All Rights Reserved.​####################################################### librealsense T265 rpy example #######################################################​# First import the libraryimportpyrealsense2asrsimportmathasm ​# Declare RealSense pipeline, encapsulating the actual device and sensorspipers.pipeline()​# Build config object and request pose datacfgrs.config()cfg.enable_stream(rs.stream.pose)​# Start streaming with requested configpipe.start(cfg)​try:while(True):# Wait for the next set of frames from the cameraframespipe.wait_for_frames()​# Fetch pose frameposeframes.get_pose_frame()ifpose:# Print some of the pose data to the terminaldatapose.get_pose_data()​# Euler angles from pose quaternion# See also https://github.com/IntelRealSense/librealsense/issues/5178#issuecomment-549795232# and https://github.com/IntelRealSense/librealsense/issues/5178#issuecomment-550217609​ wdata.rotation.w x-data.rotation.z ydata.rotation.x z-data.rotation.y ​ pitch-m.asin(2.0*(x*z-w*y))*180.0/m.pi;rollm.atan2(2.0*(w*xy*z),w*w-x*x-y*yz*z)*180.0/m.pi;yawm.atan2(2.0*(w*zx*y),w*wx*x-y*y-z*z)*180.0/m.pi;print(Frame #{}.format(pose.frame_number))print(RPY [deg]: Roll: {0:.7f}, Pitch: {1:.7f}, Yaw: {2:.7f}.format(roll,pitch,yaw))​ ​finally:pipe.stop()解决错误python3中 import pyrealsense2失败留意一下安装日志这里python的pyrealsense2库包是默认安装在了/usr/lib/python3.8/site-packages/pyrealsense2。查看一下日志或者看一下是否有 pyrealsense2 这个包ls/usr/lib/python3.8/site-packages|greppyreal*ls/usr/local/lib/python3.8/dist-packages|greppyreal*在/usr/lib/python3.8/site-packages/pyrealsense2路径下打开终端 执行python3-cimport pyrealsense2 as rs; print(rs.__version__)应该可以正常输出 v2.51.1其他路径下执行该指令错误/失败没有pyrealsense2 或者是rs.__version__不存在原因这里的pyrealsense2是cpython package类型的动态库包如果找不到或者导入失败:需要将 /usr/lib/python3.8/site-packages/pyrealsense2 目录添加到环境变量或是将 /usr/lib/python3.8/site-packages/pyrealsense2 目录下的动态库复制到项目运行目录。这里用添加环境变量的方式 修复错误添加用户级pathechoexport PYTHONPATH$PYTHONPATH:/usr/lib/python3.8/site-packages/pyrealsense2~/.bashrccat~/.bashrc|greppyrealsense2source~/.bashrcroot级path: 可选如果项目用root用户执行需要添加sudoechoexport PYTHONPATH$PYTHONPATH:/usr/lib/python3.8/site-packages/pyrealsense2/root/.bashrccat/root/.bashrc|greppyrealsense2sudosource/root/.bashrc因为用到sudo 启动服务所以最好也添加或是在启动用的bash脚本内加上export PYTHONPATH$PYTHONPATH:/usr/lib/python3.8/site-packages/pyrealsense2参考文档github: https://github.com/realsenseai/librealsense/tree/development/wrappers/python#building-from-source知乎 https://zhuanlan.zhihu.com/p/441905002csdn: https://blog.csdn.net/YOULANSHENGMENG/article/details/12935838

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询