Add gmsl_camera example

This commit is contained in:
jj
2025-02-26 15:13:30 +08:00
parent 53d714d1e4
commit dd8352d568
5 changed files with 110 additions and 2 deletions
+4
View File
@@ -14,6 +14,10 @@ How to use interleave_ae in OrbbecSDK_ROS2.
How to use disparity_search_offset in OrbbecSDK_ROS2. How to use disparity_search_offset in OrbbecSDK_ROS2.
# gmsl_camera
How to use gmsl_camera in OrbbecSDK_ROS2.
# multi_camera_synced_verification_tool # multi_camera_synced_verification_tool
How to verify the synchronization accuracy of multi-camera synced. How to verify the synchronization accuracy of multi-camera synced.
@@ -0,0 +1,47 @@
# GMSL_camera
> This section describes how to use GMSL camera in OrbbecSDK_ROS2.Currently, only G335Lg GMSL devices are supported, and other GMSL devices will be supported in the near future.
## Single GMSL camera
The usage of GMSL camera in OrbbecSDK_ROS2 is the same as that of Gemini 330 series camera via USB.
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py
```
## Multi GMSL camera
To get the `usb_port` of the GMSL camera, plug in the camera and run the following command in the terminal:
```bash
ros2 run orbbec_camera list_devices_node
```
For example, the obtained gmsl camera `usb_port`: `gmsl2-1`
Go to the [multi_camera.launch.py](../../launch/multi_camera.launch.py) file and change the `usb_port`.
```bash
ros2 launch orbbec_camera multi_camera.launch.py
```
## Multi GMSL camera synced
First, please see how to use [multi_camera_synced](../multi_camera_synced/README.MD).
In addition, GMSL multi-camera synced does not require Multi-Camera Sync Hub Pro, so there is no need to set the `primary` mode. Each GMSL camera is `secondary`.
### Additional Parameter Settings
gmsl_trigger_fps : set hardware soc trigger source frame rate.
enable_gmsl_trigger : enable hardware soc trigger.
### Run the launch
Please refer to the configuration in [multi_gmsl_camera_synced.launch.py.](multi_gmsl_camera_synced.launch.py)
```bash
ros2 launch orbbec_camera multi_gmsl_camera_synced.launch.py
```
@@ -0,0 +1,57 @@
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
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")
launch1_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_file_dir, "gemini_330_series.launch.py")
),
launch_arguments={
"camera_name": "camera_01",
"usb_port": "gmsl2-1",
"device_num": "2",
"sync_mode": "secondary_synced",
"config_file_path": config_file_path,
"trigger_out_enabled": "false",
"gmsl_trigger_fps": "3000",
"enable_gmsl_trigger": "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": "gmsl2-3",
"device_num": "2",
"sync_mode": "secondary_synced",
"config_file_path": config_file_path,
"trigger_out_enabled": "false",
"enable_gmsl_trigger": "false",
}.items(),
)
# Launch description
ld = LaunchDescription(
[
# The sending the gmsl_trigger signal gsml camera should be launched at lfirst
TimerAction(period=0.0, actions=[GroupAction([launch1_include])]),
TimerAction(period=2.0, actions=[GroupAction([launch2_include])]),
]
)
return ld
@@ -88,7 +88,7 @@ def generate_launch_description():
"device_num": "2", "device_num": "2",
"sync_mode": "primary", "sync_mode": "primary",
"config_file_path": config_file_path, "config_file_path": config_file_path,
"trigger_out_enabled": "false", "trigger_out_enabled": "true",
"attach_to_shared_component_container": attach_to_shared_component_container_arg, "attach_to_shared_component_container": attach_to_shared_component_container_arg,
"component_container_name": component_container_name_arg, "component_container_name": component_container_name_arg,
}.items(), }.items(),
@@ -23,6 +23,7 @@ def generate_launch_description():
"device_num": "2", "device_num": "2",
"sync_mode": "primary", "sync_mode": "primary",
"config_file_path": config_file_path, "config_file_path": config_file_path,
"trigger_out_enabled": "true"
}.items(), }.items(),
) )
@@ -41,7 +42,6 @@ def generate_launch_description():
) )
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
# Launch description # Launch description
ld = LaunchDescription( ld = LaunchDescription(