diff --git a/.gitignore b/.gitignore index 2181d2b6..f0ca0d45 100644 --- a/.gitignore +++ b/.gitignore @@ -764,8 +764,6 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml -docs/ -_html/ ### VisualStudio Patch ### # Additional files built by Visual Studio diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100755 index e76724e0..00000000 --- a/docs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_build -.vscode diff --git a/docs/.gitlab-ci.yml b/docs/.gitlab-ci.yml deleted file mode 100755 index 6781d05b..00000000 --- a/docs/.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -# This file is a template, and might need editing before it works on your project. -# Full project: https://gitlab.com/pages/plain-html -pages: - tags: - - html - stage: deploy - script: - - mkdir .public - - cp -r * .public - - mv .public public - artifacts: - paths: - - public - only: - - master - diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100755 index e69de29b..00000000 diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100755 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/README.md b/docs/README.md deleted file mode 100755 index 581b5679..00000000 --- a/docs/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# Docs应用文档 - -**编译:** - -```bash -cd docs -./autobuild.sh all - -``` - -**打开文档:** - -```bash -cd docs -./autobuild.sh run - -``` - -或 - -进入_html目录,手动点击index.html打开 - -# Docs应用文档详细说明 - -**采用方式:** - -1、文档格式 markdown - -2、文档转换工具 Sphinx - -3、托管 github - - -# gitlab: - -本项目源码地址: https://code.orbbec.com.cn/OrbbecSDK/OrbbecSDK_ROS2.git - -# github (待上线) - -本项目源码地址 : 待上线 -本应用文档阅读链接 : 待上线 - - -# 文档编写规范 - -1、框图、软件框架建议原则上采用processon、visio工具绘图,目的是为了保持风格统一(特殊图除外) - -2、采用标准markdown格式,可使用vscode的Editor插件编辑 - - -# 编译环境 - -pip3 install sphinx - -pip3 install recommonmark - -pip3 install sphinx_markdown_tables - -pip3 install sphinx_rtd_theme - -pip3 install sphinx_book_theme - -# 编译 - -- 执行编译脚本 ./autobuild 编译(推荐,该脚本编译后会打包docs文档及渲染设置)。 也支持sphinx原生编译指令make html -- 打开docs/index.html查看效果 - - -# 提交 - -git add 、git commit 添加注释、git push提交代码 - -提交完后,务必要上线网页打开检查一下,检查网页效果无误 - - -# 定制化部分 - -说明:定制化的配置都在**conf.py**中设置。也需要安装一些支持库 - -1. 更改样式主题。我这里以 `sphinx_rtd_theme`为例子,其他主题可自行百度。 - -* 安装 `sphinx_rtd_theme`: ` pip install sphinx_rtd_theme` - -2. 安装markdown语法支持插件:`pip install myst-parser` -3. 安装支持mermaid渲染插件: `pip install sphinxcontrib.mermaid` -4. 安装代码块一键复制按钮插件:`pip install sphinx_copybutton` -5. 可以使用vscode 编辑markdown文件文档,推荐安装markdown预览编辑插件 diff --git a/docs/align_depth_color.MD b/docs/align_depth_color.MD new file mode 100644 index 00000000..b4f57ced --- /dev/null +++ b/docs/align_depth_color.MD @@ -0,0 +1,40 @@ +## Aligning Depth to Color in ROS 2 + +This section explains how to align depth images with color images to create an overlay image using ROS 2. This is particularly useful for applications requiring synchronized visual information from different sensor modalities. + +### Commands to Align and View Depth and Color Images + +1. **Basic Depth to Color Alignment:** + + To simply align the depth image to the color image, use the following command: + + ```bash + ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true + ``` + + This command activates the depth registration feature without opening a viewer. + +2. **Viewing Depth to Color Overlay:** + + If you wish to view the depth to color overlay, you need to enable the viewer by using the command below: + + ```bash + ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true enable_d2c_viewer:=true + ``` + + This launches the camera node with depth to color registration and opens a viewer to display the overlay image. + +### Selecting Topics in RViz2 + +To visualize the aligned images in RViz2: + +1. Launch RViz2 after running one of the above commands. +2. Select the topic for the depth to color overlay image. An example topic selection is shown here: + +  + +### Example of Depth to Color Overlay + +After selecting the appropriate topic in RViz2, you will be able to see the depth to color overlay image. Here's what it might look like: + + diff --git a/docs/align_depth_color_CN.MD b/docs/align_depth_color_CN.MD new file mode 100644 index 00000000..32ef58a5 --- /dev/null +++ b/docs/align_depth_color_CN.MD @@ -0,0 +1,40 @@ +## 在ROS 2中将深度图像与彩色图像对齐 + +本节介绍如何使用ROS 2将深度图像与彩色图像对齐,以创建叠加图像。这对于需要来自不同传感器模态的同步视觉信息的应用程序特别有用。 + +### 对齐并查看深度和彩色图像的命令 + +1. **基本的深度到彩色对齐:** + + 要简单地将深度图像对齐到彩色图像,使用以下命令: + + ```bash + ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true + ``` + + 此命令激活深度注册功能,但不打开查看器。 + +2. **查看深度到彩色叠加:** + + 如果您希望查看深度到彩色叠加,您需要通过使用以下命令来启用查看器: + + ```bash + ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true enable_d2c_viewer:=true + ``` + + 这将启动具有深度到彩色注册的相机节点,并打开一个查看器以显示叠加图像。 + +### 在RViz2中选择主题 + +要在RViz2中可视化对齐的图像: + +1. 在运行上述命令之一后启动RViz2。 +2. 选择深度到彩色叠加图像的主题。这里显示了一个示例主题选择: + +  + +### 深度到彩色叠加示例 + +在RViz2中选择合适的主题后,您将能够看到深度到彩色叠加图像。这是它可能看起来的样子: + + \ No newline at end of file diff --git a/docs/autobuild.sh b/docs/autobuild.sh deleted file mode 100755 index e9d7ad8b..00000000 --- a/docs/autobuild.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash - -#set -e - -################################################################## - -################################################################## -#Function List -print_help() -{ - echo "" - echo "------------------------ help menu --------------------------" - echo " help menu option: " - echo "./autobuild.sh all ------build all" - echo "./autobuild.sh senddoc ----- send doc to server" - echo "./autobuild.sh syncdoc -----syncdoc" - echo "./autobuild.sh clean ----clean all" - echo "./autobuild.sh run ---- open html" - echo "./autobuild.sh help (-h, --help) show help menu" - echo "-------------------------------------------------------------" -} - -echo_autobuild_start() -{ - echo "" - echo -e "\e[32m*********** ./autobuild.sh $1 **************\e[0m" -} - -build_all() -{ - echo "make clean && make html" - make clean - rm -rf _html - rm -rf _build - rm -rf docs - make html - cp -R _build/html _html - cp .nojekyll _html/ - cp _html/ docs/ -af - echo "create _html finished" -} - -clean() -{ - echo "clean all" - make clean -} - -sync_doc_old() -{ - echo "copy ../robot_sdk/ ../robot_ref/ ../robot_actuator file to robot_doc/source/syncdoc/" - echo "search README.md" - readme_files=$(find ../robot_sdk/ ../robot_ref/ ../robot_actuator/ -name 'README.md') - for file in $readme_files; do - dir=$(dirname "$file") - - new_dir=$(echo "$dir" | cut -d'/' -f2-) - #echo "copy $file to source/syncdoc/$new_dir/README.md" - echo "source/syncdoc/$new_dir/README.md" - mkdir -p "source/syncdoc/$new_dir" - cp -r "$file" "source/syncdoc/$new_dir/" - if [ -d "$dir/image" ]; then - cp -r "$dir/image" "source/syncdoc/$new_dir/" - fi - done -} -sync_doc() -{ - echo "search *.rst and *.md from source code" - # readme_files=$(find ../robot_sdk/ ../robot_ref/ ../robot_actuator/ -name 'README.rst') - # readme_files=$(find ../robot_sdk/ ../robot_ref/ ../robot_actuator/ -name '*.rst' -o -name '*.md') - readme_files=$(find ../robot_sdk/ ../robot_ref/ ../robot_actuator/ -name 'README.rst' -o -name 'README.md') - for file in $readme_files; do - dir=$(dirname "$file") - new_dir=$(echo "$dir" | cut -d'/' -f2-) - #echo "copy $file to source/syncdoc/$new_dir/README.md" - mkdir -p "source/syncdoc/$new_dir" - cp -r "$file" "source/syncdoc/$new_dir/" - echo "copy $file --> source/syncdoc/$new_dir/README.rst" - echo "search image in $dir" - find "$dir" -type f \( -name "*.png" -o -name "*.gif" -o -name "*.jpg" \) | while read -r serach_file; do - target_path="source/syncdoc/$new_dir/$(echo "$serach_file" | sed "s|^$dir/||")" - mkdir -p "$(dirname "$target_path")" - cp "$serach_file" "$target_path" - echo "copy $serach_file --> $target_path" - done - done -} - -##################################################################### -# 初始化 -##################################################################### - -datetime=$(date +%Y%m%d_%H%M) -echo_autobuild_start; - -################################################################## -if [ "$#" -eq "0" ]; then - echo "unknown option: $1 [$#]. pls enter correct cmd:" - print_help; - exit 0 -fi - -while [ $# -gt 0 ]; do - echo "option=$1 total=$#:" - case $1 in - - -h | --help | help | h | --h) - print_help - ;; - - clear | clean | cl) - clean - ;; - - build | all) - build_all - ;; - - syncdoc | sync | sd) - sync_doc - ;; - - run | r) - echo "open html" - # Google Chrome的完整路径 - CHROME_PATH="/usr/bin/google-chrome" - # get full path name of html.html - HTML_FILE="$(pwd)/_build/html/index.html" - # 使用绝对路径确保脚本在任何目录下都能正确执行 - CHROME_EXECUTABLE="$(which "$CHROME_PATH")" - # 使用绝对路径确保脚本在任何目录下都能正确执行 - CHROME_EXECUTABLE="$(which "$CHROME_PATH")" - # x-www-browser _build/html/index - # open -a /Applications/Firefox.app _build/html/index - "$CHROME_EXECUTABLE" "$HTML_FILE" - ;; - senddoc | send) - echo "send doc update to 20.13" - # echo "send doc update to 10.8.170.85" - # sshpass -p pwd@123 scp -r _html/* orbbec@10.8.170.85:/var/www/html/robot_doc/ - OUT_IMAGE_SERVER_FOLDER=orbbec_sdk_ros2_doc - sshpass -p 123 ssh guojia@10.8.180.197 "[ -d /home/orbbec/.SDKBuild/20_13_build_sdk/${OUT_IMAGE_SERVER_FOLDER} ] && echo 20.13 server ready || mkdir -p /home/orbbec/.SDKBuild/20_13_build_sdk/${OUT_IMAGE_SERVER_FOLDER}" - sshpass -p 123 scp -r _html guojia@10.8.180.197:/home/orbbec/.SDKBuild/20_13_build_sdk/orbbec_sdk_ros2_doc/ - - ;; - test1 ) - echo "test1" - - ;; - test2 ) - echo "test2" - - ;; - test3 ) - echo "test3" - - ;; - *) - echo "unknown option: $1" - print_help - ;; - esac - shift -done - - - -echo "autobuild.sh end" - -################################################################## - diff --git a/docs/backup_index.txt b/docs/backup_index.txt deleted file mode 100755 index 2e4f2aa3..00000000 --- a/docs/backup_index.txt +++ /dev/null @@ -1,106 +0,0 @@ -.. [奥比中光]OrbbecSDK ROS2 应用文档.用户手册 -.. 这一页是目录树 - -OrbbecSDK ROS2 application docs -====================================================== - - -.. toctree:: - :maxdepth: 2 - :caption: 1.Overview - :titlesonly: - :numbered: - - source/overview/typical_applications.md - source/overview/supported_cameras.md - source/overview/supported_platforms.md - - -.. toctree:: - :maxdepth: 2 - :caption: 2.Installation - :titlesonly: - :numbered: - - source/installation/build_the_package.md - source/installation/package_description.md - .. source/installation/prerequisites.md - -.. toctree:: - :maxdepth: 2 - :caption: 3.Start single camera - :titlesonly: - :numbered: - - source/start_single_camera.md - - -.. toctree:: - :maxdepth: 1 - :caption: 4.Start multi camera - :titlesonly: - :numbered: - - source/start_multi_camera.md - - -.. toctree:: - :maxdepth: 2 - :caption: 5.Robot integrations - :titlesonly: - :numbered: - - source/robot_integrations.md - - -.. toctree:: - :maxdepth: 2 - :caption: 6.Advanced - :titlesonly: - :numbered: - - source/advanced/multi_camera_sync.md - source/advanced/component_node.md - source/advanced/zero_copy.md - source/advanced/gdb_debug.md - source/advanced/backward_ros.md - - -.. toctree:: - :maxdepth: 2 - :caption: 7.Tools - :titlesonly: - :numbered: - - source/tools.md - -.. toctree:: - :maxdepth: 2 - :caption: 8.Help center - :titlesonly: - :numbered: - - source/help_center/question_and_answer.md - source/help_center/issues.md - -.. toctree:: - :maxdepth: 2 - :caption: 9.(参考,待移除) - :titlesonly: - :numbered: - - source/temp/point_cloud.md - source/temp/align_depth_color.md - source/temp/fastdds_tuning.md - .. source/temp/necessary_configurations.md - source/temp/orbbec_viewer_tool.md - .. source/temp/data_display_with_rviz2.md - - -.. toctree:: - :maxdepth: 1 - :caption: 10.license - - source/license.md - LICENSE - diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100755 index 335f40d6..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,200 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - -import os -import shutil -import sphinx - -import recommonmark -from recommonmark.transform import AutoStructify - -# import sphinx_book_theme -# import sphinx_rtd_theme -# import furo - - -#choice theme default -# html_theme = 'sphinx_book_theme' -html_theme = 'sphinx_rtd_theme' -# html_theme = "furo" - -# -- Project information ----------------------------------------------------- - -project = 'OrbbecSDK ROS2' -# project = """ -# OrbbecSDK ROS2 documentation -# """ -copyright = '2023, ORBBEC INC. www.orbbec.com.cn' -author = 'ORBBEC INC. www.orbbec.com.cn' - - -# -- General configuration --------------------------------------------------- -# The master toctree document. -master_doc = 'index' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ['recommonmark', - 'sphinx_markdown_tables', - - 'sphinx.ext.autosectionlabel', - -# 'myst_parser', -] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = ['.rst', 'rest', '.md', '.MD'] - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -# language = 'zh_CN' -language = 'en' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - - -# -- Options for HTML output ------------------------------------------------- - -# html_logo = "source/_static/orbbec_logo2.png" -# html_favicon = "source/_static/orbbec_logo2.png" - -html_logo = "source/_static/orbbec-light_no_colour.svg" -html_favicon = "source/_static/web_html_logo.png" -# html_logo = "source/_static/orbbec_footerlogo_3d_world.svg" -# html_favicon = "source/_static/orbbec_footerlogo_3d_world.svg" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['source/_static','source/image'] - -html_extra_path = ['source/image'] - -html_theme_options = { - # 'analytics_id': 'G-EVD5Z6G6NH', - 'collapse_navigation': False, - # 启用导航栏的“粘性”头部,这样导航栏会固定在页面顶部 - 'sticky_navigation': True, - # 配置导航栏的深度,-1 表示显示所有层级的标题 - 'navigation_depth': 5, - # 'show_navbar_depth': 4, - # 导航栏显示+号 - 'collapse_navigation': False, - - # 'analytics_anonymize_ip': False, - # 'logo_only': False, - # 'display_version': True, - # 'prev_next_buttons_location': 'bottom', - # 'style_external_links': False, - # 'vcs_pageview_mode': '', - # 'style_nav_header_background': 'white', - # # Toc options - # 'collapse_navigation': True, - # 'sticky_navigation': True, - # 'navigation_depth': 5, - # 'includehidden': True, - # 'titles_only': False -} - - - - - - -# # 添加自定义的 JavaScript 文件 -# html_js_files = ["theme.js"] - - -# #不需要添加_static目录,加了会不起作用 -html_css_files = ["custom.css"] - -# 与文档无关的其他资源的路径,由于无需构建此文件夹的文件,会自动忽略 -# 默认情况下,此路径下的文件会输出到生成的html的根目录 -# html_extra_path = ["_extra"] - -# 在页面底部显示上一次更新于某某时间 -html_last_updated_fmt = "%Y-%m-%d %H:%M:%S" - -# 以下为 sphinx_book_theme 的主题配置/定制(sphinx_book_theme) -# html_theme_options = { -# # ----------------主题内容中导航栏的功能按钮配置-------- -# # 添加存储库链接 -# "repository_url": "https://github.com/Eugene-Forest/NoteBook", -# # 添加按钮以链接到存储库 -# "use_repository_button": True, -# # 要添加按钮以打开有关当前页面的问题 -# "use_issues_button": True, -# # 添加一个按钮来建议编辑 -# "use_edit_page_button": True, -# # 默认情况下,编辑按钮将指向master分支,但如果您想更改此设置,请使用以下配置 -# "repository_branch": "main", -# # 默认情况下,编辑按钮将指向存储库的根目录;而我们 sphinx项目的 doc文件其实是在 source 文件夹下的,包括 conf.py 和 index(.rst) 主目录 -# "path_to_docs": "source", -# # 您可以添加 use_download_button 按钮,允许用户以多种格式下载当前查看的页面 -# "use_download_button": True, - -# # --------------------------右侧辅助栏配置--------- -# # 重命名右侧边栏页内目录名,标题的默认值为Contents。 -# "toc_title": "页内目录", -# # 通常,右侧边栏页内目录中仅显示页面的第 2 级标题,只有当它们是活动部分的一部分时(在屏幕上滚动时),才会显示更深的级别。可以使用以下配置显示更深的级别,指示应显示多少级别 -# "show_toc_level": 2, - -# # --------------------------左侧边栏配置-------------- -# # logo 配置 -# "logo_only": True, -# # 控制左侧边栏列表的深度展开,默认值为1,它仅显示文档的顶级部分 -# "show_navbar_depth": 1, -# # 自定义侧边栏页脚,默认为 Theme by the Executable Book Project -# # "extra_navbar": "
Your HTML
", -# "home_page_in_toc": True, -# # ------------------------- 单页模式 ----------------- -# # 如果您的文档只有一个页面,并且您不需要左侧导航栏,那么您可以 使用以下配置将其配置sphinx-book-theme 为以单页模式运行 -# # "single_page": True, -# } - -# 是否显示页面下方的由sphinx创建, 默认为True -html_show_sphinx = False - -# Function to copy video files to output directory -def setup(app): - app.connect('build-finished', copy_videos) - -def copy_videos(app, exception): - if exception is None: # Only copy if build succeeded - src_dir = os.path.join(app.srcdir, '_static/videos') - dest_dir = os.path.join(app.outdir, '_static/videos') - if os.path.exists(src_dir): - shutil.copytree(src_dir, dest_dir) - -# 20201030 -def setup(app): - app.add_config_value('recommonmark_config', { - 'url_resolver': lambda url: github_doc_root + url, - 'auto_toc_tree_section': 'Contents', - }, True) - app.add_transform(AutoStructify) \ No newline at end of file diff --git a/docs/source/5_advanced/fastdds_tuning.md b/docs/fastdds_tuning.md old mode 100755 new mode 100644 similarity index 88% rename from docs/source/5_advanced/fastdds_tuning.md rename to docs/fastdds_tuning.md index 0ae3fbfd..1e1ad021 --- a/docs/source/5_advanced/fastdds_tuning.md +++ b/docs/fastdds_tuning.md @@ -1,12 +1,12 @@ -# FastDDS tuning +# Fast DDS Optimization for Orbbec Camera with ROS2 -When operating with the default configuration, FastDDS exhibits suboptimal transmission efficiency, resulting in +When operating with the default configuration, Fast DDS exhibits suboptimal transmission efficiency, resulting in significant image transmission delays when used with the Orbbec camera in ROS2. This document provides guidance on -optimizing FastDDS to enhance image transfer efficiency. +optimizing Fast DDS to enhance image transfer efficiency. -## Adjusting system parameters +## 1. Adjusting System Parameters -### IP fragmentation time +### IP Fragmentation Time - **Path**: `/proc/sys/net/ipv4/ipfrag_time` (default: 30 seconds) - **Purpose**: Defines the duration that IP fragments are kept in memory. @@ -19,7 +19,7 @@ optimizing FastDDS to enhance image transfer efficiency. sudo sysctl net.ipv4.ipfrag_time=3 ``` -### IP fragmentation memory threshold +### IP Fragmentation Memory Threshold - **Path**: `/proc/sys/net/ipv4/ipfrag_high_thresh` (default: 262144 bytes) - **Purpose**: Sets the maximum memory used to reassemble IP fragments. @@ -32,7 +32,7 @@ optimizing FastDDS to enhance image transfer efficiency. sudo sysctl net.ipv4.ipfrag_high_thresh=134217728 ``` -### Maximum buffer sizes +### Maximum Buffer Sizes - **Purpose**: Configures the maximum buffer sizes for receiving and sending data, which is critical for high-throughput data transmission. @@ -67,12 +67,12 @@ then save and exit the file. run `sudo sysctl -p` to apply the changes. For detailed guidance, refer to [ROS 2 DDS Tuning Documentation](https://docs.ros.org/en/foxy/How-To-Guides/DDS-tuning.html). -## 2. FastDDS configuration +## 2. Fast DDS Configuration -Below is an example of a FastDDS configuration file optimized for ROS2 usage with the Orbbec camera. This configuration +Below is an example of a Fast DDS configuration file optimized for ROS2 usage with the Orbbec camera. This configuration enhances the overall data transmission by adjusting buffer sizes and transport settings. -### Configuration file: `shm_fastdds.xml` +### Configuration File: `shm_fastdds.xml` Place this file in the `$HOME` directory. @@ -140,9 +140,9 @@ Place this file in the `$HOME` directory. ``` -### Environment variables +### Environment Variables -Set the following environment variables to use the custom FastDDS profile: +Set the following environment variables to use the custom Fast DDS profile: ```bash export RMW_IMPLEMENTATION=rmw_fastrtps_cpp diff --git a/docs/source/image/image1.jpg b/docs/images/image1.jpg old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image1.jpg rename to docs/images/image1.jpg diff --git a/docs/source/image/image2.jpg b/docs/images/image2.jpg old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image2.jpg rename to docs/images/image2.jpg diff --git a/docs/source/image/image3.png b/docs/images/image3.png old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image3.png rename to docs/images/image3.png diff --git a/docs/source/image/image4.jpg b/docs/images/image4.jpg old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image4.jpg rename to docs/images/image4.jpg diff --git a/docs/source/image/image5.jpg b/docs/images/image5.jpg old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image5.jpg rename to docs/images/image5.jpg diff --git a/docs/source/image/image6.jpg b/docs/images/image6.jpg old mode 100755 new mode 100644 similarity index 100% rename from docs/source/image/image6.jpg rename to docs/images/image6.jpg diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100755 index f69ec8fa..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. [奥比中光]OrbbecSDK ROS2 应用文档.用户手册 -.. 这一页是目录树 -.. :titlesonly: - - - -.. image:: source/image/product_h5.png - -====================================================== - - -OrbbecSDK_ROS2 -====================================================== - - -.. toctree:: - :maxdepth: 2 - :caption: Table of Contents - :numbered: - - source/1_overview/overview.rst - source/2_installation/installation.rst - source/3_start_single_camera/single_camera.rst - source/4_start_multi_camera/multi_camera.rst - source/5_advanced/advanced.rst - source/6_tools/tool.rst - source/7_help_center/help_center.rst - source/8_license/sdk_license.rst - - - - -====================================================== - -.. image:: source/image/product_h1.png diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100755 index 2119f510..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/multi_camera.MD b/docs/multi_camera.MD new file mode 100644 index 00000000..15a67f29 --- /dev/null +++ b/docs/multi_camera.MD @@ -0,0 +1,108 @@ +## Using Multiple Cameras with the Orbbec ROS 2 Package + +This section describes how to configure and use multiple Orbbec cameras simultaneously in a ROS 2 environment. + +### Identifying Camera USB Ports + +#### Script to List Connected Cameras + +To determine which USB ports the cameras are connected to, you can use the following bash script. This script lists all Orbbec devices attached to the system along with their USB port and serial number. + +```bash +#!/bin/bash + +VID="2bc5" + +for dev in /sys/bus/usb/devices/*; do + if [ -e "$dev/idVendor" ]; then + vid=$(cat "$dev/idVendor") + if [ "$vid" == "${VID}" ]; then + port=$(basename $dev) + product=$(cat "$dev/product" 2>/dev/null) # product name + serial=$(cat "$dev/serial" 2>/dev/null) # serial number + echo "Found Orbbec device $product, usb port $port, serial number $serial" + fi + fi +done +``` + +Save this script to a file and execute it in your terminal to output a list of connected cameras. + +### Launching Multiple Cameras + +#### Setup for Multiple Camera Launch + +You can launch multiple cameras by specifying different USB ports for each camera. Below is an example Python script that uses the ROS 2 launch system to start two cameras with individual configurations. + +```python +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess +from launch.launch_description_sources from ament_index_python.packages import get_package_share_directory +import os + +def generate_launch_description(): + package_dir = get_package_share_directory('orbbec_camera') + launch_file_dir = os.path.join(package_dir, 'launch') + + launch1_include = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(launch_file_dir, 'gemini_330_series.launch.py')), + launch_arguments={'camera_name': 'camera_01', 'usb_port': '2-3.4.4.4.1', 'device_num': '2', 'sync_mode': 'free_run'}.items() + ) + + launch2_include = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(launch_file_dir, 'gemini_330_series.launch.py')), + launch_arguments={'camera_name': 'camera_02', 'usb_port': '2-3.4.4.4.3', 'device_num': '2', 'sync_mode': 'free_run'}.items() + ) + + ld = LaunchDescription([ + GroupAction([launch1_include]), + GroupAction([launch2_include]) + ]) + + return ld +``` + +#### Running the Launch File + +To execute the launch configuration for multiple cameras, use the command: + +```bash +ros2 launch orbbec_camera multi_camera.launch.py +``` + +### Configuring the TF Tree for Multiple Cameras + +#### Example TF Configuration for Two Cameras + +When using multiple cameras, it's essential to calibrate them and publish a static TF tree for each camera. The following Python script configures the TF tree based on your calibration results: + +```python +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + ld = LaunchDescription([ + Node( + package='tf2_ros', + executable='static_transform_publisher', + name='camera_01_tf', + arguments=['0', '0', '0', '0', '0', '0', 'base_link', 'camera_01_link'], + output='screen' + ), + Node( + package='tf2_ros', + executable='static_transform_publisher', + name='camera_02_tf', + arguments=['0', '0', '0', '0', '0', '0', 'base_link', 'camera_02_link'], + output='screen' + ) + ]) + + return ld +``` + +Save this configuration as `multi_camera_tf.launch.py` in the launch directory of the Orbbec camera package. To run it, use: + +```bash +ros2 launch orbbec_camera multi_camera_tf.launch.py +``` diff --git a/docs/multi_camera_CN.MD b/docs/multi_camera_CN.MD new file mode 100644 index 00000000..7ca6b054 --- /dev/null +++ b/docs/multi_camera_CN.MD @@ -0,0 +1,109 @@ +## 使用Orbbec ROS 2包配置多个摄像头 + +本节介绍如何在ROS 2环境中同时配置和使用多个Orbbec摄像头。 + +### 识别摄像头USB端口 + +#### 列出连接的摄像头的脚本 + +要确定摄像头连接到哪些USB端口,您可以使用以下bash脚本。该脚本列出了连接到系统的所有Orbbec设备及其USB端口和序列号。 + +```bash +#!/bin/bash + +VID="2bc5" + +for dev in /sys/bus/usb/devices/*; do + if [ -e "$dev/idVendor" ]; then + vid=$(cat "$dev/idVendor") + if [ "$vid" == "${VID}" ]; then + port=$(basename $dev) + product=$(cat "$dev/product" 2>/dev/null) # 产品名称 + serial=$(cat "$dev/serial" 2>/dev/null) # 序列号 + echo "发现Orbbec设备 $product,usb端口 $port,序列号 $serial" + fi + fi +done +``` + +将此脚本保存为一个文件,并在您的终端中执行,以输出连接的摄像头列表。 + +### 启动多个摄像头 + +#### 多摄像头启动配置 + +您可以通过为每个摄像头指定不同的USB端口来启动多个摄像头。下面是一个使用ROS 2启动系统启动两个摄像头的Python脚本示例。 + +```python +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess +from launch.launch_description_sources import PythonLaunchDescriptionSource +from ament_index_python.packages import get_package_share_directory +import os + +def generate_launch_description(): + package_dir = get_package_share_directory('orbbec_camera') + launch_file_dir = os.path.join(package_dir, 'launch') + + launch1_include = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(launch_file_dir, 'gemini_330_series.launch.py')), + launch_arguments={'camera_name': 'camera_01', 'usb_port': '2-3.4.4.4.1', 'device_num': '2', 'sync_mode': 'free_run'}.items() + ) + + launch2_include = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(launch_file_dir, 'gemini_330_series.launch.py')), + launch_arguments={'camera_name': 'camera_02', 'usb_port': '2-3.4.4.4.3', 'device_num': '2', 'sync_mode': 'free_run'}.items() + ) + + ld = LaunchDescription([ + GroupAction([launch1_include]), + GroupAction([launch2_include]) + ]) + + return ld +``` + +#### 运行启动文件 + +要执行多摄像头的启动配置,请使用命令: + +```bash +ros2 launch orbbec_camera multi_camera.launch.py +``` + +### 配置多摄像头的TF树 + +#### 两个摄像头的TF配置示例 + +使用多个摄像头时,校准它们并为每个摄像头发布静态TF树是必不可少的。以下Python脚本基于您的校准结果配置TF树: + +```python +from launch import LaunchDescription +from launch_ros.actions import Node + +def generate_launch_description(): + ld = LaunchDescription([ + Node( + package='tf2_ros', + executable='static_transform_publisher', + name='camera_01_tf', + arguments=['0', '0', '0', '0', '0', '0', 'base_link', 'camera_01_link'], + output='screen' + ), + Node( + package='tf2_ros', + executable='static_transform_publisher', + name='camera_02_tf', + arguments=['0', '0', '0', '0', '0', '0', 'base_link', 'camera_02_link'], + output='screen' + ) + ]) + + return ld +``` + +将此配置保存为 `multi_camera_tf.launch.py` 在Orbbec摄像头包的启动目录中。运行它,请使用: + +```bash +ros2 launch orbbec_camera multi_camera_tf.launch.py +``` \ No newline at end of file diff --git a/docs/openHtml.bat b/docs/openHtml.bat deleted file mode 100755 index db0fa7d0..00000000 --- a/docs/openHtml.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -echo ***************************************** -echo *** jacky.li tools *** -echo ***************************************** -set CURRENT_TIME=%time:~0,2%:%time:~3,2%:%time:~6,2% -Echo %CURRENT_TIME% - - -echo current patch %~dp0% -start chrome.exe "file://%~dp0%_html\index.html" - -echo start chrome.exe "file://%~dp0%_html\index.html" \ No newline at end of file diff --git a/docs/point_cloud.MD b/docs/point_cloud.MD new file mode 100644 index 00000000..692e9991 --- /dev/null +++ b/docs/point_cloud.MD @@ -0,0 +1,53 @@ +## Enabling and Visualizing Point Cloud in ROS 2 + +This section demonstrates how to enable point cloud data output from the camera node and visualize it using RViz2, similarly to the initial camera node setup discussed in the [Starting Camera Node](./start_camera_node.MD) document. + +### Enabling Depth Point Cloud + +#### Command to Enable Depth Point Cloud + +To activate the point cloud data stream for depth information, use the following command: + +```bash +ros2 launch orbbec_camera gemini_330_series.launch.py enable_point_cloud:=true +``` + +#### Visualizing Depth Point Cloud in RViz2 + +After running the above command, perform the following steps to visualize the depth point cloud: + +1. Open RViz2. +2. Add a `PointCloud2` display. +3. Select the `/camera/depth/points` topic for visualization. +4. Set the fixed frame to `camera_link` to properly align the data. + +##### Example Visualization + +Here is what the depth point cloud might look like in RViz2: + + + +### Enabling Colored Point Cloud + +#### Command to Enable Colored Point Cloud + +To enable the colored point cloud feature, enter the following command: + +```bash +ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true +``` + +#### Visualizing Colored Point Cloud in RViz2 + +To visualize the colored point cloud data: + +1. Launch RViz2 following the command execution. +2. Add a `PointCloud2` display panel. +3. Choose the `/camera/depth_registered/points` topic from the list. +4. Ensure the fixed frame is set to `camera_link`. + +##### Example Visualization + +The result of the colored point cloud in RViz2 should look similar to this: + + diff --git a/docs/point_cloud_CN.MD b/docs/point_cloud_CN.MD new file mode 100644 index 00000000..8ebb419b --- /dev/null +++ b/docs/point_cloud_CN.MD @@ -0,0 +1,53 @@ +## 在ROS 2中启用和可视化点云 + +本节演示如何从相机节点启用点云数据输出,并使用RViz2进行可视化,类似于之前讨论的[启动相机节点](./start_camera_node.MD)文档中的初始相机节点设置。 + +### 启用深度点云 + +#### 启用深度点云的命令 + +要激活深度信息的点云数据流,请使用以下命令: + +```bash +ros2 launch orbbec_camera gemini_330_series.launch.py enable_point_cloud:=true +``` + +#### 在RViz2中可视化深度点云 + +运行上述命令后,执行以下步骤来可视化深度点云: + +1. 打开RViz2。 +2. 添加一个`PointCloud2`显示。 +3. 选择`/camera/depth/points`主题进行可视化。 +4. 将固定帧设置为`camera_link`以正确对齐数据。 + +##### 示例可视化 + +以下是在RViz2中可能看到的深度点云的样子: + + + +### 启用彩色点云 + +#### 启用彩色点云的命令 + +要启用彩色点云功能,请输入以下命令: + +```bash +ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true +``` + +#### 在RViz2中可视化彩色点云 + +要可视化彩色点云数据: + +1. 在执行命令后启动RViz2。 +2. 添加一个`PointCloud2`显示面板。 +3. 从列表中选择`/camera/depth_registered/points`主题。 +4. 确保固定帧设置为`camera_link`。 + +##### 示例可视化 + +在RViz2中彩色点云的结果应类似于这样: + + \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100755 index ea30deb3..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,20 +0,0 @@ -# markdown suport -recommonmark -# markdown table suport -sphinx-markdown-tables - -# theme default rtd - -# crate-docs-theme -sphinx-rtd-theme - -doc8 -docutils -pip -sphinx -sphinx-copybutton -sphinx-lint -sphinx-multiversion -sphinx-rtd-theme -sphinx-tabs -sphinxcontrib-mermaid \ No newline at end of file diff --git a/docs/source/1_overview/overview.rst b/docs/source/1_overview/overview.rst deleted file mode 100755 index 599224b4..00000000 --- a/docs/source/1_overview/overview.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. 这一页是模块目录树 - - -.. image:: ../image/product_h5.png - -====================================================== - - -Overview -====================================================== - -.. image:: http://badges.github.io/stability-badges/dist/stable.svg -.. image:: https://img.shields.io/badge/version-2.0.8-green - -------------------------------------------------------------------- - -OrbbecSDK_ROS2 is a wrapper for the Orbbec 3D camera that provides seamless integration with the ROS2 environment. It -supports ROS2 Foxy, Humble, Iron, and Jazzy distributions. - - -OrbbecSDK ROS2 souce code link: -`https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main