-
-

5.2.3. Multi_camera_synced_verification_tool

-
-

This article will introduce how to verify the synchronization accuracy of multi-camera synchronization.

-

First, please see how to use multi_camera_synced.

-
-

You can find example usage code in the example.

-
-

5.2.3.1. Directory Structure

-
.
-├── multicamera_sync/
-│   ├── output/
-│       ├──20250218102900/
-│          ├──DevicesInfo.txt
-│          ├──StreamProfileInfo.txt
-│   ├── Python/
-│       ├──Config.ini
-├── gemini_330_series_synced_verify.launch.py
-├── multi_camera_synced_verify.launch.py
-
-
-

multicamera_sync

-
    -
  • gemini_330_series_synced_verify.launch.py : Single camera runs launch, which provides the camera running node for multi_camera_synced_verify.launch.py.

  • -
  • multi_camera_synced_verify.launch.py : Multi camer synced + launch of save_rgbir tool.

  • -
-

output

-
-

The ouput folder is the folder where the camera pictures are output

-
-

In the output example provided

-
    -
  • 20250218102900 : Represents the camera image information collected at 10:29:00 on February 18, 2025.

  • -
  • TotalModeFrames : Camera image information storage directory.

  • -
  • results-2025-02-25_163648 : The result after analyzing and matching the image information of TotalModeFrames.

  • -
  • DevicesInfo.txt : Camera equipment basic information (need to be modified).

  • -
  • StreamProfileInfo.txt : Camera video stream information (no need to modify).

  • -
-

Python

-
    -
  • Config.ini : Configuration file for Python analysis script (need to be modified).

  • +
    +

    5.2.3. Multi-Camera Synchronization Verification Node

    +

    File path: image_sync_example_node.cpp

    +

    This example node is designed for synchronized capture and timestamp verification across four Orbbec cameras. +It can be used to validate frame alignment accuracy under the multi-camera Primary / Secondary Synced mode.

    +
    +
    +

    5.2.3.1. Usage Guide

    +
    +

    5.2.3.1.1. Modify multi_camera_synced.launch.py as follows

    +
      +
    • Add launch_include to support four cameras.

    • +
    • Select the appropriate launch file based on your camera model. +For example, use gemini_330_series.launch.py for the Gemini 330 series.

    • +
    • Naming convention: +camera_name should follow the format camera_01, camera_02, camera_03, …

    • +
    • Set device_num to 4.

    • +
    • Configure the USB ports using:

      +

      ros2 run orbbec_camera list_devices_node

      +

      to view and bind the correct ports.

      +
    • +
    • Set synchronization mode to Primary/Secondary Synced, +with one camera as primary and the others as secondary_synced.

    • +
    • Startup sequence: +The Primary camera should always be launched last to ensure the synchronization signal is established correctly.

    -
    -

    5.2.3.2. Preparation for operation

    -

    save_rgbir node

    -

    Edit multi_camera_synced_verify.launch.py and fill in the activated camera device,we can find that save_rgbir is started at the end.

    -
    -

    IMPORTANT

    -

    If you are using ROS 2 Foxy, you need to launch the save_rgbir node first.

    -
    -
    # Launch description
    +
    +
    +

    5.2.3.1.2. Modify configuration files

    +

    Edit the following two files under the config directory:

    +
      +
    • camera_params.yaml

    • +
    • camera_secondary_params.yaml

    • +
    +

    Ensure the following settings are consistent across all cameras:

    +
      +
    • Enable both depth and color streams.

    • +
    • Use the same frame rate (fps) for all cameras.

    • +
    +
    +
    +
    +

    5.2.3.1.3. Launch and Verification

    +
      +
    • Start the multi-camera synchronization launch file:

      +

      ros2 launch orbbec_camera multi_camera_synced.launch.py

      +
    • +
    • In a new terminal, run the synchronization verification node:

      +

      ros2 run orbbec_camera image_sync_example_node

      +

      This node outputs timestamp differences between multiple camera streams for synchronization validation.

      +
    • +
    +
    +
    +
    +

    5.2.3.1.4. Reference Launch File

    +
    import os
    +from ament_index_python.packages import get_package_share_directory
    +from launch import LaunchDescription
    +from launch_ros.actions import Node
    +from launch.actions import IncludeLaunchDescription, GroupAction, TimerAction
    +from launch.launch_description_sources import PythonLaunchDescriptionSource
    +from launch_ros.actions import Node, LoadComposableNodes
    +
    +
    +
    +def generate_launch_description():
    +    # Include launch files
    +    package_dir = get_package_share_directory("orbbec_camera")
    +    launch_file_dir = os.path.join(package_dir, "launch")
    +    config_file_dir = os.path.join(package_dir, "config")
    +    config_file_path = os.path.join(config_file_dir, "camera_params.yaml")
    +    secondary_config_file_path = os.path.join(config_file_dir, "camera_secondary_params.yaml")
    +
    +    launch1_include = IncludeLaunchDescription(
    +        PythonLaunchDescriptionSource(
    +            os.path.join(launch_file_dir, "gemini_330_series.launch.py")
    +        ),
    +        launch_arguments={
    +            "camera_name": "camera_01",
    +            "usb_port": "2-2.3",
    +            "device_num": "4",
    +            "sync_mode": "primary",
    +            "config_file_path": config_file_path,
    +            "trigger_out_enabled": "true"
    +        }.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-1",
    +            "device_num": "4",
    +            "sync_mode": "secondary_synced",
    +            "config_file_path": secondary_config_file_path,
    +            "trigger_out_enabled": "false"
    +        }.items(),
    +    )
    +
    +    launch3_include = IncludeLaunchDescription(
    +        PythonLaunchDescriptionSource(
    +            os.path.join(launch_file_dir, "gemini_330_series.launch.py")
    +        ),
    +        launch_arguments={
    +            "camera_name": "camera_03",
    +            "usb_port": "2-3",
    +            "device_num": "4",
    +            "sync_mode": "secondary_synced",
    +            "config_file_path": secondary_config_file_path,
    +            "trigger_out_enabled": "false"
    +        }.items(),
    +    )
    +
    +    launch4_include = IncludeLaunchDescription(
    +        PythonLaunchDescriptionSource(
    +            os.path.join(launch_file_dir, "gemini_330_series.launch.py")
    +        ),
    +        launch_arguments={
    +            "camera_name": "camera_04",
    +            "usb_port": "2-4",
    +            "device_num": "4",
    +            "sync_mode": "secondary_synced",
    +            "config_file_path": secondary_config_file_path,
    +            "trigger_out_enabled": "false"
    +        }.items(),
    +    )
    +
    +
    +
    +    # Launch description
         ld = LaunchDescription(
             [
    -            shared_orbbec_container,
    +
                 TimerAction(period=0.0, actions=[GroupAction([launch2_include])]),
    -            TimerAction(period=2.0, actions=[GroupAction([launch1_include])]),
    +            TimerAction(period=2.0, actions=[GroupAction([launch3_include])]),
    +            TimerAction(period=4.0, actions=[GroupAction([launch4_include])]),
    +            TimerAction(period=6.0, actions=[GroupAction([launch1_include])]),
                 # The primary camera should be launched at last
    -            TimerAction(period=6.0, actions=[GroupAction([save_rgbir])]),
    -            # save_rgbir is synced verification tool
             ]
         )
     
         return ld
     
    -

    save_rgbir is a tool for saving images. The configuration file of this tool is in multi_save_rgbir_params.json.

    -
    {
    -  "save_rgbir_params": {
    -      "time_domain": "global",
    -      "usb_ports": [
    -          "2-1",
    -          "2-3"
    -      ],
    -      "camera_name": [
    -          "camera_01",
    -          "camera_02"
    -      ]
    -  }
    -}
    -
    -
    -
      -
    • time_domain : Timestamp Type

    • -
    • usb_ports : “primary”, “secondary 1”, “secondary 2”, “secondary 3”, fill in as many usb_ports as there are cameras

    • -
    • camera_name : The name of the camera setting, for example: camera_01

    • -
    -

    DevicesInfo.txt

    -

    Edit DevicesInfo.txt. Only the primarySerialNumber, index and serialNumber parameters need to be changed. Other parameters do not need to be changed.Refer to the example of 20250218102900.

    -
      -
    • primarySerialNumber : The SN serial number of the primary camera

    • -
    • index : Camera index

    • -
    • serialNumber : The SN serial number of the camera

    • -
    -

    Config.ini

    -

    Edit Config.ini.Modify frameRate and tspRangeThreshold.

    -
    -

    5.2.3.3. Run this example

    -

    Run launch and save camera pictures

    -
      -
    • First terminal

    • -
    -
    ros2 launch orbbec_camera multi_camera_synced_verify.launch.py
    -
    -
    -
      -
    • Second terminal

    • -
    -
    ros2 service call /save_rgbir/start_capture orbbec_camera_msgs/srv/SetInt32 '{data: 100}'
    -
    -
    -

    When the terminal displays “over”, the image is saved.A new multicamera_sync folder will be generated under the workspace.

    -

    Camera pictures naming format

    -

    Take color_SNCP1E5420006D_Index0_g1739874543227_f0_s1739874543327_e50_d16_.jpg as an example

    -
      -
    • color : This image is a snapshot of the color stream.

    • -
    • SNCP1E5420006D : The camera’s SN serial number is CP1E5420006D.

    • -
    • Index0 : Camera 0 (usually referred to primary camera).

    • -
    • g1739874543227 : “g” represents the global timestamp, which means the global timestamp of this frame is 1739874543227.

    • -
    • f0 : The 0th picture of the color stream acquisition of this camera.

    • -
    • s1739874543327 : “s” represents the timestamp of the current system, which means the current system timestamp of this frame is 1739874543327.

    • -
    • e50 : The exposure of this frame is 50.

    • -
    • d16 : The gain of this frame is 16.

    • -
    -

    Analyzing camera image data

    -

    You need to copy the modified Python folder to the new multi_camera_synced subdirectory, and copy the modified DevicesInfo.txt and StreamProfileInfo.txt to the same level directory as the TotalModeFrames folder.

    -
      -
    • Finally everything is ready, run the python script

    • -
    -
    cd multicamera_sync/Python
    -python3 SyncFramesMain.py
    -
    -
    -

    After the operation is successful, you can view the synchronization effect in the results folder

    -
    -

    5.2.3.4. Files that need to be changed

    -

    Analysis tools

    - -

    Camera Configuration

    -

    camera_params.yaml(Camera startup parameter settings)

    -

    multi_camera_synced_verify.launch.py

    +
    +
    +

    5.2.3.2. System Configuration Requirements

    +
    +

    5.2.3.2.1. Increase USB Buffer Memory

    +

    Prevent frame drops caused by concurrent data transmission:

    +

    echo 512 | sudo tee /sys/module/usbcore/parameters/usbfs_memory_mb

    +
    +
    +

    5.2.3.2.2. Configure Fast DDS

    +

    Optimize ROS2 node communication latency to reduce image transmission delay. +See this section for detailed configuration instructions.

    +
    @@ -522,7 +546,7 @@ python3 SyncFramesMain.py

    © Copyright 2025, ORBBEC INC. www.orbbec.com.. - Last updated on 2025-10-31 02:59:36. + Last updated on 2025-11-17 01:39:33.

    diff --git a/en/source/5_advanced_guide/performance/efficient_intra_process_communication.html b/en/source/5_advanced_guide/performance/efficient_intra_process_communication.html index 499340b8..9443b1e9 100644 --- a/en/source/5_advanced_guide/performance/efficient_intra_process_communication.html +++ b/en/source/5_advanced_guide/performance/efficient_intra_process_communication.html @@ -217,11 +217,19 @@
  • 5.2.2.4. Run the following command to start the multi-camera synced
-
  • 5.2.3. Multi_camera_synced_verification_tool
  • diff --git a/en/source/7_developer_guide/building_a_Debian_Package.html b/en/source/7_developer_guide/building_a_Debian_Package.html index 88343b6e..39599205 100644 --- a/en/source/7_developer_guide/building_a_Debian_Package.html +++ b/en/source/7_developer_guide/building_a_Debian_Package.html @@ -217,11 +217,19 @@
  • 5.2.2.4. Run the following command to start the multi-camera synced