• NVIDIA Jetson TX2 解决奥比中光 Astra pro相机的ros 打不开深度信息/camera/depth/image


    背景:

    NVIDIA Jetson TX2 安装奥比中光 Astra pro相机的ROS 驱动后可以打开彩色相机,
    打不开深度信息,有点捉急,换了一台相机,还是如此,说明相机没问题驱动有问题。

    打开奥比中光的开发者论坛:
    Astra pro无法读取到深度信息,如何设置成uvc模式?
    留意到:
    Astra Pro相机的深度图是 openni 协议, 彩色图是 uvc 协议,一下子有解决问题的思路啦。

    一 . 先下载驱动
    https://developer.orbbec.com.cn/download.html?id=64
    在这里插入图片描述
    下载下来是:
    OpenNI_v2.3.0.85_20220615_1b09bbfd_linux_x64_release.zip 是 x64 的,NVIDIA Jetson TX2 不能用
    因为NVIDIA Jetson TX2

    $ arch
    aarch64
    $ dpkg --print-architecture
    arm64
    
    • 1
    • 2
    • 3
    • 4

    参考:Ubuntu 20.04 - 查看操作系统架构
    参考:奥比中光Orbbec Astra pro 深度相机在ROS Melodic的使用 安装OpenNI-Linux-Arm64-2.3.0.66 驱动
    下载地址:
    https://dl.orbbec3d.com/dist/openni2/OpenNI_2.3.0.66.zip

    $ cd OpenNI_2.3.0.66/Linux
    $ ls
    OpenNI-Linux-Arm-2.3.0.66    OpenNI-Linux-x64-2.3.0.66
    OpenNI-Linux-Arm64-2.3.0.66  OpenNI-Linux-x86-2.3.0.66
    
    • 1
    • 2
    • 3
    • 4

    有符合NVIDIA Jetson TX2 的 OpenNI-Linux-Arm64-2.3.0.66

    1. 安装OpenNI
    unzip OpenNI_2.3.0.66.zip
    cd OpenNI_2.3.0.66/Linux/OpenNI-Linux-Arm64-2.3.0.66
    chmod +x install.sh
    sudo ./install.sh
    
    • 1
    • 2
    • 3
    • 4
    1. 重新拔插设备
    2. 初始化OpenNI环境
    source OpenNIDevEnvironment
    
    • 1
    1. 编译运行
    cd Samples/SimpleViewer
    make
    
    • 1
    • 2

    make的时候出现问题

    Viewer.h:24:10: fatal error: OpenNI.h: No such file or directory
     #include 
              ^~~~~~~~~~
    compilation terminated.
    
    • 1
    • 2
    • 3
    • 4
     sudo find / -name "OpenNI.h"
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Linux/OpenNI-Linux-Arm64-2.3.0.66/include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Linux/OpenNI-Linux-x86-2.3.0.66/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Linux/OpenNI-Linux-Arm-2.3.0.66/include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Linux/OpenNI-Linux-x64-2.3.0.66/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Android/Sample/cpp-demos/irforopenni2/app/src/main/cpp/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Android/Sample/java-demos/irforopenni2/app/src/main/cpp/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Android/SDK/include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Windows/SDK/x86/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Windows/SDK/x64/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Windows/Samples/samples.old/ThirdParty/openni/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Windows/Samples/samples.old/ThirdParty/OpenNI2/Include/OpenNI.h
    /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Windows/Samples/thirdparty/OpenNI2/Include/OpenNI.h
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    修改目录下的Makefile

    INC_DIRS = /home/wxf/newdisk/softwares/OpenNI_2.3.0.66/Linux/OpenNI-Linux-Arm64-2.3.0.66/include\
            ../../Include \
            ../../ThirdParty/GL/ \
            ../Common
    
    • 1
    • 2
    • 3
    • 4

    重新编译

    make -j4
    cd /Bin/Arm64-Release
    sudo -s
    ./SimpleViewer
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述
    成功说明相机的 ir 模块 没有问题

    二. 安装 ros 版本
    下载 OpenNI_SDK_ROS_v1.0.9_20220725_0bf97f_Linux.tar.gz
    在这里插入图片描述
    同时参考乐视三合一奥比中光Orbbec Astra Pro在ROS中配置显示RGB、深度、IR图像的两种思路
    ubuntu20.04 noetic 安装 Astra Pro 驱动

    sudo apt-get install ros-melodic-uvc-camera
    
    • 1

    然后解压,发现目录下为 ros_astra_camera
    参考NVIDIA Jetson TX2 安装 Astra相机的ros驱动源码 错误总结安装运行

    roslaunch astra_camera astrapro.launch
    
    • 1

    rostopic list

    $ rostopic list
    /camera/camera_connected
    /camera/camera_disconnected
    /camera/camera_nodelet_manager/bond
    /camera/camera_rgb/parameter_descriptions
    /camera/camera_rgb/parameter_updates
    /camera/depth/camera_info
    /camera/depth/image
    /camera/depth/image/compressed
    /camera/depth/image/compressed/parameter_descriptions
    /camera/depth/image/compressed/parameter_updates
    /camera/depth/image/compressedDepth
    /camera/depth/image/compressedDepth/parameter_descriptions
    /camera/depth/image/compressedDepth/parameter_updates
    /camera/depth/image/theora
    /camera/depth/image/theora/parameter_descriptions
    /camera/depth/image/theora/parameter_updates
    /camera/depth/image_raw
    /camera/depth/image_raw/compressed
    /camera/depth/image_raw/compressed/parameter_descriptions
    /camera/depth/image_raw/compressed/parameter_updates
    /camera/depth/image_raw/compressedDepth
    /camera/depth/image_raw/compressedDepth/parameter_descriptions
    /camera/depth/image_raw/compressedDepth/parameter_updates
    /camera/depth/image_raw/theora
    /camera/depth/image_raw/theora/parameter_descriptions
    /camera/depth/image_raw/theora/parameter_updates
    /camera/depth/image_rect
    /camera/depth/image_rect/compressed
    /camera/depth/image_rect/compressed/parameter_descriptions
    /camera/depth/image_rect/compressed/parameter_updates
    /camera/depth/image_rect/compressedDepth
    /camera/depth/image_rect/compressedDepth/parameter_descriptions
    /camera/depth/image_rect/compressedDepth/parameter_updates
    /camera/depth/image_rect/theora
    /camera/depth/image_rect/theora/parameter_descriptions
    /camera/depth/image_rect/theora/parameter_updates
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressed
    /camera/depth/image_rect_raw/compressed/parameter_descriptions
    /camera/depth/image_rect_raw/compressed/parameter_updates
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/depth/image_rect_raw/compressedDepth/parameter_updates
    /camera/depth/image_rect_raw/theora
    /camera/depth/image_rect_raw/theora/parameter_descriptions
    /camera/depth/image_rect_raw/theora/parameter_updates
    /camera/depth/points
    /camera/depth_rectify_depth/parameter_descriptions
    /camera/depth_rectify_depth/parameter_updates
    /camera/depth_registered/camera_info
    /camera/depth_registered/hw_registered/image_rect
    /camera/depth_registered/hw_registered/image_rect/compressed
    /camera/depth_registered/hw_registered/image_rect/compressed/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect/compressed/parameter_updates
    /camera/depth_registered/hw_registered/image_rect/compressedDepth
    /camera/depth_registered/hw_registered/image_rect/compressedDepth/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect/compressedDepth/parameter_updates
    /camera/depth_registered/hw_registered/image_rect/theora
    /camera/depth_registered/hw_registered/image_rect/theora/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect/theora/parameter_updates
    /camera/depth_registered/hw_registered/image_rect_raw
    /camera/depth_registered/hw_registered/image_rect_raw/compressed
    /camera/depth_registered/hw_registered/image_rect_raw/compressed/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect_raw/compressed/parameter_updates
    /camera/depth_registered/hw_registered/image_rect_raw/compressedDepth
    /camera/depth_registered/hw_registered/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect_raw/compressedDepth/parameter_updates
    /camera/depth_registered/hw_registered/image_rect_raw/theora
    /camera/depth_registered/hw_registered/image_rect_raw/theora/parameter_descriptions
    /camera/depth_registered/hw_registered/image_rect_raw/theora/parameter_updates
    /camera/depth_registered/image
    /camera/depth_registered/image/compressed
    /camera/depth_registered/image/compressed/parameter_descriptions
    /camera/depth_registered/image/compressed/parameter_updates
    /camera/depth_registered/image/compressedDepth
    /camera/depth_registered/image/compressedDepth/parameter_descriptions
    /camera/depth_registered/image/compressedDepth/parameter_updates
    /camera/depth_registered/image/theora
    /camera/depth_registered/image/theora/parameter_descriptions
    /camera/depth_registered/image/theora/parameter_updates
    /camera/depth_registered/image_raw
    /camera/depth_registered/image_raw/compressed
    /camera/depth_registered/image_raw/compressed/parameter_descriptions
    /camera/depth_registered/image_raw/compressed/parameter_updates
    /camera/depth_registered/image_raw/compressedDepth
    /camera/depth_registered/image_raw/compressedDepth/parameter_descriptions
    /camera/depth_registered/image_raw/compressedDepth/parameter_updates
    /camera/depth_registered/image_raw/theora
    /camera/depth_registered/image_raw/theora/parameter_descriptions
    /camera/depth_registered/image_raw/theora/parameter_updates
    /camera/depth_registered/points
    /camera/depth_registered_rectify_depth/parameter_descriptions
    /camera/depth_registered_rectify_depth/parameter_updates
    /camera/driver/parameter_descriptions
    /camera/driver/parameter_updates
    /camera/ir/camera_info
    /camera/ir/image
    /camera/ir/image/compressed
    /camera/ir/image/compressed/parameter_descriptions
    /camera/ir/image/compressed/parameter_updates
    /camera/ir/image/compressedDepth
    /camera/ir/image/compressedDepth/parameter_descriptions
    /camera/ir/image/compressedDepth/parameter_updates
    /camera/ir/image/theora
    /camera/ir/image/theora/parameter_descriptions
    /camera/ir/image/theora/parameter_updates
    /camera/projector/camera_info
    /camera/rgb/camera_info
    /camera/rgb/image_raw
    /camera/rgb/image_raw/compressed
    /camera/rgb/image_raw/compressed/parameter_descriptions
    /camera/rgb/image_raw/compressed/parameter_updates
    /camera/rgb/image_raw/compressedDepth
    /camera/rgb/image_raw/compressedDepth/parameter_descriptions
    /camera/rgb/image_raw/compressedDepth/parameter_updates
    /camera/rgb/image_raw/theora
    /camera/rgb/image_raw/theora/parameter_descriptions
    /camera/rgb/image_raw/theora/parameter_updates
    /camera/rgb/image_rect_color
    /camera/rgb/image_rect_color/compressed
    /camera/rgb/image_rect_color/compressed/parameter_descriptions
    /camera/rgb/image_rect_color/compressed/parameter_updates
    /camera/rgb/image_rect_color/compressedDepth
    /camera/rgb/image_rect_color/compressedDepth/parameter_descriptions
    /camera/rgb/image_rect_color/compressedDepth/parameter_updates
    /camera/rgb/image_rect_color/theora
    /camera/rgb/image_rect_color/theora/parameter_descriptions
    /camera/rgb/image_rect_color/theora/parameter_updates
    /camera/rgb_rectify_color/parameter_descriptions
    /camera/rgb_rectify_color/parameter_updates
    /rosout
    /rosout_agg
    /tf_static
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134

    如果还有问题,更新软件包:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    
    • 1
    • 2
    • 3
  • 相关阅读:
    【C++ Efficiency】使用运算符的复合形式取代其单独形式,效率更高
    前端逆向之下载canvas引用的图片
    从react源码看hooks的原理
    MySQL 有这一篇就够(呕心狂敲37k字,只为博君一点赞!!!)
    性能测试 —— 性能测试常见的测试指标 !
    性能调优读书笔记(上篇)
    无代码资讯|SAP发布低代码平台;钉钉低代码应用数破500万;轻流举办无代码城市论坛......
    谷歌浏览器再次引入争议API,遭苹果、火狐抵制
    Web服务器简介及HTTP协议
    Git初识与安装
  • 原文地址:https://blog.csdn.net/weixin_40378209/article/details/126903064