1 Star 0 Fork 0

奥比中光科技集团股份有限公司 / OrbbecSDK_ROS1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Orbbec ROS SDK

稳定(http://github.com/badges/stability-badges) 版本

注意:此文档是通过机器翻译生成且不会及时更新,仅供参考。具体内容请以英文原文为准。

Orbbec ROS SDK 是 OrbbecSDK 的一个封装,支持 ROS Kinetic、Melodic 和 Noetic 发行版。此 SDK 使 Orbbec 3D 摄像机能够平滑地集成到 ROS 项目中。

目录

安装依赖

ROS

  • 请直接参阅ROS wiki获取安装指南。

其他依赖

  • 安装依赖(注意您的ROS发行版):

    # 假设您已经源设置了ROS环境,同下
    sudo apt install libgflags-dev ros-$ROS_DISTRO-image-geometry ros-$ROS_DISTRO-camera-info-manager \
    ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-image-publisher libgoogle-glog-dev libusb-1.0-0-dev libeigen3-dev \
    ros-$ROS_DISTRO-diagnostic-updater ros-$ROS_DISTRO-diagnostic-msgs

创建ROS工作区并构建

创建一个ROS工作区(如果您还没有):

mkdir -p ~/ros_ws/src

获取源代码:

cd ~/ros_ws/src
git clone https://github.com/orbbec/OrbbecSDK_ROS1.git

构建包:

cd ~/ros_ws
catkin_make

安装udev规则:

cd ~/ros_ws
source ./devel/setup.bash
roscd orbbec_camera
cd scripts
sudo cp 99-obsensor-libusb.rules /etc/udev/rules.d/99-obsensor-libusb.rules
sudo udevadm control --reload && sudo udevadm trigger

启动摄像头

在终端1:

source ./devel/setup.bash
roslaunch orbbec_camera gemini_330_series.launch

在终端2:

source ./devel/setup.bash
rviz

选择主题并控制摄像头

检查主题、服务和参数(开启一个新终端):

rostopic list
rosservice list
rosparam list

获取摄像头参数(必须先启动流):

rosservice call /camera/get_camera_params "{}"

检查摄像头参数(请参考ROS文档了解 camera info中的具体字段含义):

rostopic echo /camera/depth/camera_info
rostopic echo /camera/color/camera_info

检查设备信息:

rosservice call /camera/get_device_info "{}"

获取SDK版本(包括固件和Orbbec SDK版本):

rosservice call /camera/get_sdk_version "{}"

设置/获取(自动)曝光:

rosservice call /camera/set_color_auto_exposure '{data: false}'
rosservice call /camera/set_left_ir_auto_exposure "{data: false}"

# 设置曝光值(小心数据范围;下面的示例可能不正确)
rosservice call /camera/set_left_ir_exposure "{data: 2000}"
rosservice call /camera/set_color_exposure "{data: 2000}"

# 获取曝光
rosservice call /camera/get_left_ir_exposure "{}"
rosservice call /camera/get_color_exposure "{}"

设置/获取增益:

# 获取增益
rosservice call /camera/get_color_gain '{}'
rosservice call /camera/get_left_ir_gain '{}'

# 设置增益(小心数据范围;下面的示例可能不正确)
rosservice call /camera/set_color_gain "{data: 200}"
rosservice call /camera/set_left_ir_gain "{data: 200}"

设置/获取(自动)白平衡:

rosservice call /camera/set_auto_white_balance "{data: false}"
rosservice call /camera/get_auto_white_balance "{data: false}"

开启/关闭激光:

rosservice call /camera/set_laser '{data: true}' # 开启
rosservice call /camera/set_laser '{data: false}' # 关闭

保存图片:

rosservice call /camera/save_images "{}"

保存点云:

rosservice call /camera/save_point_cloud "{}"

注意:图片保存在~/.ros/image目录下,只有当传感器开启时才可用。

可用的摄像头控制服务

服务名称直观反映了其用途。至关重要的是要理解,与设置或获取参数相关的服务——标记为set_*get_*——仅在相应的enable_* 参数激活时可用。例如,激活左红外(IR)功能需要enable_left_ir,右红外功能需要enable_right_ir ,深度感知功能需要enable_depth,或颜色处理功能需要enable_color(参考启动参数 )是这些对应服务运行的先决条件。这种配置确保仅当在启动文件的流参数中启用了特定流时,服务才可访问。

  • /camera/get_auto_white_balance
  • /camera/get_camera_params
  • /camera/get_color_auto_exposure
  • /camera/get_color_camera_info
  • /camera/get_color_exposure
  • /camera/get_color_gain
  • /camera/get_depth_auto_exposure
  • /camera/get_depth_camera_info
  • /camera/get_depth_exposure
  • /camera/get_depth_gain
  • /camera/get_device_info
  • /camera/get_device_type
  • /camera/get_left_ir_auto_exposure
  • /camera/get_left_ir_camera_info
  • /camera/get_left_ir_exposure
  • /camera/get_left_ir_gain
  • /camera/get_serial
  • /camera/get_sdk_version
  • /camera/get_white_balance
  • /camera/reset_color_exposure
  • /camera/reset_color_gain
  • /camera/reset_depth_exposure
  • /camera/reset_depth_gain
  • /camera/reset_left_ir_exposure
  • /camera/reset_left_ir_gain
  • /camera/reset_white_balance
  • /camera/save_images
  • /camera/save_point_cloud
  • /camera/set_auto_white_balance
  • /camera/set_color_auto_exposure
  • /camera/set_color_exposure
  • /camera/set_color_gain
  • /camera/set_depth_auto_exposure
  • /camera/set_depth_exposure
  • /camera/set_depth_gain
  • /camera/set_flood
  • `/camera/set

_left_ir_auto_exposure`

  • /camera/set_left_ir_exposure
  • /camera/set_left_ir_gain
  • /camera/set_laser
  • /camera/set_white_balance

可用的主题

  • /camera/color/camera_info:彩色摄像头信息。
  • /camera/color/image_raw:彩色流图像。
  • /camera/depth/camera_info:深度摄像头信息。
  • /camera/depth/image_raw:深度流图像。
  • /camera/depth/points:点云,仅在enable_point_cloudtrue时可用。
  • /camera/depth_registered/points:彩色点云,仅在enable_colored_point_cloudtrue时可用。
  • /camera/left_ir/camera_info:左IR摄像头信息。
  • /camera/left_ir/image_raw:左IR流图像。
  • /camera/right_ir/camera_info:右IR摄像头信息。
  • /camera/right_ir/image_raw:右IR流图像。

启动参数

以下启动参数可用:

  • connection_delay:重新打开设备的延迟时间(毫秒)。某些设备需要较长时间初始化,立即重新打开设备可能会导致固件崩溃,特别是在热插拔时。
  • enable_point_cloud:启用点云。
  • enable_colored_point_cloud:启用RGB点云。
  • color_widthcolor_heightcolor_fps:彩色流的分辨率和帧率。
  • left_ir_widthleft_ir_heightleft_ir_fps:左IR流的分辨率和帧率。
  • right_ir_widthright_ir_heightright_ir_fps:右IR流的分辨率和帧率。
  • depth_widthdepth_heightdepth_fps:深度流的分辨率和帧率。
  • enable_color:启用RGB摄像头。
  • enable_depth:启用深度摄像头。
  • enable_left_ir:启用左IR摄像头。
  • enable_right_ir:启用右IR摄像头。
  • depth_registration:启用深度帧到彩色帧的硬件对齐。当enable_colored_point_cloud设置为true时,此字段是必需的。
  • log_level用于OrbbecSDK控制台日志详细程度,级别为noneinfodebugwarnfatal。日志保存在~/.ros/Log 中。要进行文件日志记录,请调整config/OrbbecSDKConfig_v1.0.xml中的<FileLogLevel>
  • oredered_pc:点云是否应组织为有序网格(true)或作为无序点集(false)。
  • device_preset:设备预设选项为DefaultHigh Accuracy
  • enable_decimation_filter:此滤波有效减少深度场景复杂性。滤波在[2x2]到[8x8]像素的核心大小上运行。图像大小在两个维度上按比例缩小,以保持宽高比。
  • enable_hdr_merge:此滤波与深度HDR功能联用。通过合并交替曝光值的连续深度图像,我们可以同时克服获取过度照明和光照不足物体的深度值的挑战。
  • sequence_id_filter_id:此滤波与深度HDR功能联用,并仅输出指定序列ID的序列。
  • enable_threshold_filter:此滤波保留感兴趣的深度值,并省略超出范围的深度值。
  • enable_noise_removal_filter:此滤波去除簇状斑点噪声,并导致深度图更少填充。
  • enable_spatial_filter:此滤

镜根据大小参数执行多次迭代处理,以增强深度数据的平滑性。它还能填充深度图中的小孔。

  • enable_temporal_filter:此滤波旨在通过操纵基于先前帧的每个像素值来提高深度数据的持久性。滤波对数据进行单次处理,调整深度值的同时也更新跟踪历史。
  • enable_hole_filling_filter:此滤波使用指定的模式填充深度图中的所有孔洞。
  • depth_precision:深度精度,应为1mm格式。默认值为1mm
  • enable_laser:是否启用激光。默认值为true
  • laser_on_off_mode:激光开/关交替模式,0:关闭,1:开-关交替,2:关-开交替。默认值为0
  • retry_on_usb3_detection_failure:如果摄像头连接到USB 2.0端口未被检测到,系统将尝试重置摄像头最多三次。此设置旨在防止USB 3.0设备被错误地识别为USB 2.0。建议在使用USB 2.0连接时将此参数设置为false,以避免不必要的重置。

深度工作模式切换:

  • 在启动摄像头之前,可以为相应的xxx.launch文件配置深度工作模式(depth_work_mode)。
  • 深度工作模式切换由Gemini 2、Gemini 2 L和Gemini 2 XL摄像头支持。
  • xxx.launch的默认深度工作模式配置是摄像头的默认配置。如果需要修改,请根据需要切换到相应模式。
  • 具体的摄像头深度工作模式支持类型可以在深度模式的注释中找到。
<!-- Depth work mode support is as follows: -->
<!-- Unbinned Dense Default -->
<!-- Unbinned Sparse Default -->
<!-- Binned Sparse Default -->
<!-- Obstacle Avoidance -->
<arg name="depth_work_mode" default=""/>
  • 查看深度工作模式:
rosrun orbbec_camera list_depth_work_mode_node

配置深度NFOV和WFOV模式

对于Femto Mega和Femto Bolt设备,通过在启动文件中配置深度和IR的分辨率实现NFOV和WFOV模式。在启动文件中,depth_width、depth_height、ir_width、ir_height代表深度和IR的分辨率。IR的帧速率和分辨率必须与深度一致。不同模式与分辨率之间的对应关系如下:

  • NFOV未合并:640 x 576。
  • NFOV合并:320 x 288。
  • WFOV未合并:1024 x 1024。
  • WFOV合并:512 x 512。

检查摄像头支持哪些配置文件

rosrun orbbec_camera list_camera_profile_mode_node

构建Debian包

首先,确保安装了必要的工具:

sudo apt install debhelper fakeroot python3-bloom

要创建Debian包,请执行以下命令:

cd ~/ros_ws/src/OrbbecSDK_ROS1
bash .make_deb.sh

启动文件

产品系列 启动文件
astra+ astra_adv.launch
astra mini/astra mini pro/astra pro astra.launch
astra mini s pro astra.launch
astra2 astra2.launch
astra stereo s stereo_s_u3.launch
astra pro2 astra_pro2.launch
dabai dabai.launch
dabai d1 dabai_d1.launch
dabai dcw dabai_dcw.launch
dabai dw dabai_dw.launch
dabai pro dabai_pro.launch
deeya deeya.launch
femto / femto w femto.launch
femto mega femto_mega.launch
femto bolt femto_bolt.launch
gemini gemini.launch
gemini gemini.launch
gemini2 / dabai DCL gemini2.launch
gemini2L gemini2L.launch
gemini e gemini_e.launch
gemini e lite gemini_e_lite.launch
dabai max dabai_max.launch
dabai max pro dabai_max_pro.launch
gemini uw gemini_uw.launch
dabai dcw2 dabai_dcw2.launch
dabai dw2 dabai_dw2.launch
gemini ew gemini_ew.launch
gemini ew lite gemini_ew_lite.launch
gemini 335 /335 L gemini_330_series.launch

所有启动文件基本相似,主要区别在于为不同模型设置的参数默认值不同 在同一系列中。USB标准的差异,例如USB 2.0与USB 3.0,可能需要调整这些参数。如果您 遇到启动失败,请仔细查看规格手册。特别注意启动文件中的分辨率设置,以及其他参数,以确保兼容性和最佳性能。

使用Nodelet

对于需要使用nodelet的用户,请参考gemini2_nodelet.launch

支持的硬件产品

产品支持

产品列表 固件版本
Gemini 335 1.2.20
Gemini 335L 1.2.20
Femto Bolt 1.0.6/1.0.9
Femto Mega 1.1.7/1.2.7
Gemini 2 XL Obox: V1.2.5 VL:1.4.54
Astra 2 2.8.20
Gemini 2 L 1.4.32
Gemini 2 1.4.60 /1.4.76
Astra+ 1.0.22/1.0.21/1.0.20/1.0.19
Femto 1.6.7
Femto W 1.1.8
DaBai 2436
DaBai DCW 2460
DaBai DW 2606
Astra Mini Pro 1007
Gemini E 3460
Gemini E Lite 3606
Gemini 3.0.18
Astra Mini S Pro 1.0.05

常见问题

多相机无画面

  • 可能是电源供应不足。为避免这种情况,不要将所有摄像头连接到同一个集线器上,而应使用带电源的集线器。

  • 还可能是分辨率过高。解决这个问题,尝试降低分辨率。

错误:"设备启动失败:usbEnumerator createUsbDevice失败!"

  • 当前设备没有权限访问设备。检查当前设备的PID:

    lsusb | grep 2bc5

    您的输出应该看起来像这样:

    Bus 002 Device 007: ID 2bc5:your_pid_here

    编辑/etc/udev/rules.d/99-obsensor-libusb.rules并添加以下行:

    SUBSYSTEM=="usb", ATTR{idProduct}=="
    

your_pid_here", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="your_device_name_here"


将`your_pid_here`替换为您设备的PID,将`your_device_name_here`替换为您想为设备创建的名称(例如,`gemini_camera`)。

然后重启udev服务:

```bash
sudo udevadm control --reload-rules && sudo service udev restart && sudo udevadm trigger

许可证

版权所有 2024 Orbbec Ltd.

根据Apache许可证,版本2.0(“许可证”)授权;除非符合许可证,否则您不得使用此项目。您可以在

http://www.apache.org/licenses/LICENSE-2.0

获得许可证副本。

除非适用法律要求或书面同意,根据许可证分发的软件将按“原样”基础提供,不附带任何形式的明示或暗示的保证或条件。请参阅许可证了解权限和限制的具体语言。

其他名称和品牌可能是其他所有者的财产。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [2023] [Orbbec 3D Technology, Inc] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Orbbec ROS SDK是Orbbec SDK的封装,支持ROS Kinetic、Melodic和Noetic等发行版。 展开 收起
C++ 等 5 种语言
Apache-2.0
取消

发行版 (5)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/orbbecdeveloper/OrbbecSDK_ROS1.git
git@gitee.com:orbbecdeveloper/OrbbecSDK_ROS1.git
orbbecdeveloper
OrbbecSDK_ROS1
OrbbecSDK_ROS1
main

搜索帮助