mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-12 15:29:49 +08:00
docs: update multi-camera synchronization guidance
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
ros2 run orbbec_camera list_devices_node
|
ros2 run orbbec_camera list_devices_node
|
||||||
```
|
```
|
||||||
|
|
||||||
- Set the `device_num` parameter to the number of cameras you have.
|
|
||||||
- Go to the `OrbbecSDK_ROS2/orbbec_camera/launch/multi_xxx.launch.py` file and change the `usb_port`.
|
- Go to the `OrbbecSDK_ROS2/orbbec_camera/launch/multi_xxx.launch.py` file and change the `usb_port`.
|
||||||
- Don't forget to put the `include` tag inside the `group` tag.
|
- Don't forget to put the `include` tag inside the `group` tag.
|
||||||
Otherwise, the parameter values of different cameras may become contaminated.
|
Otherwise, the parameter values of different cameras may become contaminated.
|
||||||
@@ -31,7 +30,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_01',
|
'camera_name': 'camera_01',
|
||||||
'usb_port': '6-2.4.4.2', # replace your usb port here
|
'usb_port': '6-2.4.4.2', # replace your usb port here
|
||||||
'device_num': '2'
|
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,11 +40,10 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_02',
|
'camera_name': 'camera_02',
|
||||||
'usb_port': '6-2.4.1', # replace your usb port here
|
'usb_port': '6-2.4.1', # replace your usb port here
|
||||||
'device_num': '2'
|
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
# If you need more cameras, just add more launch_include here and change the usb_port
|
||||||
|
|
||||||
# Launch description
|
# Launch description
|
||||||
ld = LaunchDescription([
|
ld = LaunchDescription([
|
||||||
|
|||||||
@@ -27,13 +27,11 @@ Open multi_camera_synced.launch.py, and configure the camera settings as shown b
|
|||||||
|
|
||||||
3. Set `usb_port` to `2-2`, indicating that the camera device on port `2-2` is being used. This value can be found in the output of the `ros2 run orbbec_camera list_devices_node` command.
|
3. Set `usb_port` to `2-2`, indicating that the camera device on port `2-2` is being used. This value can be found in the output of the `ros2 run orbbec_camera list_devices_node` command.
|
||||||
|
|
||||||
4. Set `device_num` to `2`, meaning two cameras will be used.
|
4. Set `sync_mode` to `primary` to indicate that the `2-7` camera device is in primary mode. The multi-camera sync mode options can be found in the figure below.
|
||||||
|
|
||||||
5. Set `sync_mode` to `primary` to indicate that the `2-7` camera device is in primary mode. The multi-camera sync mode options can be found in the figure below.
|
5. Parameters from the `config_file_path` can override the parameters set in `gemini_330_series.launch.py` (optional).
|
||||||
|
|
||||||
6. Parameters from the `config_file_path` can override the parameters set in `gemini_330_series.launch.py` (optional).
|
6. For slave cameras, set `trigger_out_enabled` to false.
|
||||||
|
|
||||||
7. For slave cameras, set `trigger_out_enabled` to false.
|
|
||||||
|
|
||||||
| **Pattern Nam**e | **Setting effect description** |
|
| **Pattern Nam**e | **Setting effect description** |
|
||||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
|||||||
+5
-11
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
**File path:** [image_sync_example_node.cpp](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/examples/multi_camera_time_sync/image_sync_example_node.cpp)
|
**File path:** [image_sync_example_node.cpp](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/examples/multi_camera_time_sync/image_sync_example_node.cpp)
|
||||||
|
|
||||||
This example node is designed for **synchronized capture and timestamp verification** across **four Orbbec cameras**.
|
This example node performs synchronized capture and timestamp verification across multiple Orbbec cameras and supports **1 to 8 image topics** at a time.
|
||||||
It can be used to validate frame alignment accuracy under the multi-camera **Primary / Secondary Synced** mode.
|
At startup, it automatically discovers published color/depth image topics and can be used to validate frame alignment accuracy under the multi-camera **Primary / Secondary Synced** mode.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ It can be used to validate frame alignment accuracy under the multi-camera **Pri
|
|||||||
|
|
||||||
### **Modify `multi_camera_synced.launch.py` as follows**
|
### **Modify `multi_camera_synced.launch.py` as follows**
|
||||||
|
|
||||||
- Add `launch_include` to support four cameras.
|
- Adjust `launch_include` according to the number of cameras participating in synchronization.
|
||||||
|
|
||||||
- Select the appropriate launch file based on your camera model.
|
- Select the appropriate launch file based on your camera model.
|
||||||
For example, use `gemini_330_series.launch.py` for the Gemini 330 series.
|
For example, use `gemini_330_series.launch.py` for the Gemini 330 series.
|
||||||
@@ -19,8 +19,6 @@ It can be used to validate frame alignment accuracy under the multi-camera **Pri
|
|||||||
- Naming convention:
|
- Naming convention:
|
||||||
`camera_name` should follow the format `camera_01`, `camera_02`, `camera_03`, ...
|
`camera_name` should follow the format `camera_01`, `camera_02`, `camera_03`, ...
|
||||||
|
|
||||||
- Set `device_num` to **4**.
|
|
||||||
|
|
||||||
- Configure the USB ports using:
|
- Configure the USB ports using:
|
||||||
|
|
||||||
`ros2 run orbbec_camera list_devices_node`
|
`ros2 run orbbec_camera list_devices_node`
|
||||||
@@ -61,11 +59,11 @@ It can be used to validate frame alignment accuracy under the multi-camera **Pri
|
|||||||
|
|
||||||
`ros2 run orbbec_camera image_sync_example_node`
|
`ros2 run orbbec_camera image_sync_example_node`
|
||||||
|
|
||||||
This node outputs timestamp differences between multiple camera streams for synchronization validation.
|
The node automatically discovers color/depth image topics from the running cameras, displays synchronized images, and outputs timestamp differences and FPS statistics for synchronization validation.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### **Reference Launch File**
|
### **Four-Camera Reference Launch File**
|
||||||
|
|
||||||
```
|
```
|
||||||
import os
|
import os
|
||||||
@@ -93,7 +91,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_01",
|
"camera_name": "camera_01",
|
||||||
"usb_port": "2-2.3",
|
"usb_port": "2-2.3",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "primary",
|
"sync_mode": "primary",
|
||||||
"config_file_path": config_file_path,
|
"config_file_path": config_file_path,
|
||||||
"trigger_out_enabled": "true"
|
"trigger_out_enabled": "true"
|
||||||
@@ -107,7 +104,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_02",
|
"camera_name": "camera_02",
|
||||||
"usb_port": "2-1",
|
"usb_port": "2-1",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
@@ -121,7 +117,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_03",
|
"camera_name": "camera_03",
|
||||||
"usb_port": "2-3",
|
"usb_port": "2-3",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
@@ -135,7 +130,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_04",
|
"camera_name": "camera_04",
|
||||||
"usb_port": "2-4",
|
"usb_port": "2-4",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
ros2 run orbbec_camera list_devices_node
|
ros2 run orbbec_camera list_devices_node
|
||||||
```
|
```
|
||||||
|
|
||||||
- 将 `device_num` 参数设置为您拥有的相机数量。
|
|
||||||
- 转到 `OrbbecSDK_ROS2/orbbec_camera/launch/multi_xxx.launch.py` 文件并更改 `usb_port`。
|
- 转到 `OrbbecSDK_ROS2/orbbec_camera/launch/multi_xxx.launch.py` 文件并更改 `usb_port`。
|
||||||
- 不要忘记将 `include` 标签放在 `group` 标签内。
|
- 不要忘记将 `include` 标签放在 `group` 标签内。
|
||||||
否则,不同相机的参数值可能会被污染。
|
否则,不同相机的参数值可能会被污染。
|
||||||
@@ -31,7 +30,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_01',
|
'camera_name': 'camera_01',
|
||||||
'usb_port': '6-2.4.4.2', # replace your usb port here
|
'usb_port': '6-2.4.4.2', # replace your usb port here
|
||||||
'device_num': '2'
|
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,11 +40,10 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_02',
|
'camera_name': 'camera_02',
|
||||||
'usb_port': '6-2.4.1', # replace your usb port here
|
'usb_port': '6-2.4.1', # replace your usb port here
|
||||||
'device_num': '2'
|
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
# If you need more cameras, just add more launch_include here and change the usb_port
|
||||||
|
|
||||||
# Launch description
|
# Launch description
|
||||||
ld = LaunchDescription([
|
ld = LaunchDescription([
|
||||||
|
|||||||
@@ -27,13 +27,11 @@ ros2 run orbbec_camera list_devices_node
|
|||||||
|
|
||||||
3. 将 `usb_port` 设置为 `2-2`,表示正在使用端口 `2-2` 上的相机设备。此值可以在 `ros2 run orbbec_camera list_devices_node` 命令的输出中找到。
|
3. 将 `usb_port` 设置为 `2-2`,表示正在使用端口 `2-2` 上的相机设备。此值可以在 `ros2 run orbbec_camera list_devices_node` 命令的输出中找到。
|
||||||
|
|
||||||
4. 将 `device_num` 设置为 `2`,表示将使用两个相机。
|
4. 将 `sync_mode` 设置为 `primary`,表示 `2-7` 相机设备处于主模式。多相机同步模式选项可以在下图中找到。
|
||||||
|
|
||||||
5. 将 `sync_mode` 设置为 `primary`,表示 `2-7` 相机设备处于主模式。多相机同步模式选项可以在下图中找到。
|
5. 来自 `config_file_path` 的参数可以覆盖在 `gemini_330_series.launch.py` 中设置的参数(可选)。
|
||||||
|
|
||||||
6. 来自 `config_file_path` 的参数可以覆盖在 `gemini_330_series.launch.py` 中设置的参数(可选)。
|
6. 对于从属相机,将 `trigger_out_enabled` 设置为 false。
|
||||||
|
|
||||||
7. 对于从属相机,将 `trigger_out_enabled` 设置为 false。
|
|
||||||
|
|
||||||
| **模式名称** | **设置效果说明** |
|
| **模式名称** | **设置效果说明** |
|
||||||
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
|||||||
+5
-11
@@ -2,21 +2,19 @@
|
|||||||
|
|
||||||
文件路径:[image_sync_example_node.cpp](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/examples/multi_camera_time_sync/image_sync_example_node.cpp)
|
文件路径:[image_sync_example_node.cpp](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/examples/multi_camera_time_sync/image_sync_example_node.cpp)
|
||||||
|
|
||||||
此示例节点用于 **4 台 Orbbec 相机** 的同步采集与时间戳验证。
|
此示例节点用于多台 Orbbec 相机的同步采集与时间戳验证,支持同时验证 **1~8 路图像 topic**。
|
||||||
它可用于验证多相机主从同步(Primary / Secondary Synced)模式下的帧对齐精度。
|
节点启动时会自动发现已发布的 color/depth 图像 topic,可用于验证多相机主从同步(Primary / Secondary Synced)模式下的帧对齐精度。
|
||||||
|
|
||||||
## 使用教程
|
## 使用教程
|
||||||
|
|
||||||
### **在 `multi_camera_synced.launch.py` 的基础上做以下修改**
|
### **在 `multi_camera_synced.launch.py` 的基础上做以下修改**
|
||||||
|
|
||||||
- 增加 `launch_include` 以适配 4 台相机
|
- 根据参与同步的相机数量调整 `launch_include`
|
||||||
|
|
||||||
- 根据设备型号选择对应的 launch 文件,如 330 系列选择 gemini_330_series.launch.py
|
- 根据设备型号选择对应的 launch 文件,如 330 系列选择 gemini_330_series.launch.py
|
||||||
|
|
||||||
- 命名规范:camera_name 命名方式 camera_01、camera_02、camera_03 ...
|
- 命名规范:camera_name 命名方式 camera_01、camera_02、camera_03 ...
|
||||||
|
|
||||||
- 设置 device_num 数量为 4
|
|
||||||
|
|
||||||
- USB 端口配置 usb_port,使用以下命令查看并绑定正确的端口
|
- USB 端口配置 usb_port,使用以下命令查看并绑定正确的端口
|
||||||
`ros2 run orbbec_camera list_devices_node`
|
`ros2 run orbbec_camera list_devices_node`
|
||||||
|
|
||||||
@@ -46,11 +44,11 @@
|
|||||||
- 启动多机同步 launch: `multi_camera_synced.launch.py`
|
- 启动多机同步 launch: `multi_camera_synced.launch.py`
|
||||||
|
|
||||||
- 打开新终端运行同步验证节点: `ros2 run orbbec_camera image_sync_example_node`
|
- 打开新终端运行同步验证节点: `ros2 run orbbec_camera image_sync_example_node`
|
||||||
该节点会输出多相机图像的时间戳差异信息,用于验证同步效果。
|
该节点会自动发现已启动相机的 color/depth 图像 topic,显示同步图像,并输出时间戳差异和 FPS 统计,用于验证同步效果。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### **参考 launch 文件**
|
### **4 台相机参考 launch 文件**
|
||||||
|
|
||||||
```
|
```
|
||||||
import os
|
import os
|
||||||
@@ -78,7 +76,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_01",
|
"camera_name": "camera_01",
|
||||||
"usb_port": "2-2.3",
|
"usb_port": "2-2.3",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "primary",
|
"sync_mode": "primary",
|
||||||
"config_file_path": config_file_path,
|
"config_file_path": config_file_path,
|
||||||
"trigger_out_enabled": "true"
|
"trigger_out_enabled": "true"
|
||||||
@@ -92,7 +89,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_02",
|
"camera_name": "camera_02",
|
||||||
"usb_port": "2-1",
|
"usb_port": "2-1",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
@@ -106,7 +102,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_03",
|
"camera_name": "camera_03",
|
||||||
"usb_port": "2-3",
|
"usb_port": "2-3",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
@@ -120,7 +115,6 @@ def generate_launch_description():
|
|||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "camera_04",
|
"camera_name": "camera_04",
|
||||||
"usb_port": "2-4",
|
"usb_port": "2-4",
|
||||||
"device_num": "4",
|
|
||||||
"sync_mode": "secondary_synced",
|
"sync_mode": "secondary_synced",
|
||||||
"config_file_path": secondary_config_file_path,
|
"config_file_path": secondary_config_file_path,
|
||||||
"trigger_out_enabled": "false"
|
"trigger_out_enabled": "false"
|
||||||
|
|||||||
Reference in New Issue
Block a user