mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 03:57:46 +08:00
add frame drop judgement
This commit is contained in:
@@ -183,8 +183,8 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('enable_hardware_reset', default_value='false'),
|
||||
DeclareLaunchArgument('interleave_ae_mode', default_value='laser'), # 'hdr' or 'laser'
|
||||
DeclareLaunchArgument('interleave_frame_enable', default_value='true'),
|
||||
DeclareLaunchArgument('interleave_skip_enable', default_value='false'),
|
||||
DeclareLaunchArgument('interleave_skip_index', default_value='1'), # 0:skip pattern ir 1: skip flood ir
|
||||
DeclareLaunchArgument('interleave_skip_enable', default_value='true'),
|
||||
DeclareLaunchArgument('interleave_skip_index', default_value='0'), # 0:skip pattern ir 1: skip flood ir
|
||||
]
|
||||
|
||||
def get_params(context, args):
|
||||
|
||||
@@ -5,7 +5,6 @@ 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")
|
||||
@@ -13,83 +12,64 @@ def generate_launch_description():
|
||||
config_file_dir = os.path.join(package_dir, "config")
|
||||
config_file_path = os.path.join(config_file_dir, "camera_params.yaml")
|
||||
|
||||
G0_51 = IncludeLaunchDescription(
|
||||
front_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "G0_51",
|
||||
"usb_port": "2-2",
|
||||
"device_num": "4",
|
||||
"sync_mode": "primary",
|
||||
"enable_left_ir":"true",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
|
||||
G1_54 = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "G1_54",
|
||||
"usb_port": "2-3.3",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"enable_left_ir":"true",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
G2_5Y = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "G2_5Y",
|
||||
"usb_port": "2-3.1",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"enable_left_ir":"true",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
G3_47 = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "G3_47",
|
||||
"camera_name": "front_camera",
|
||||
"usb_port": "2-1",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"enable_left_ir":"true",
|
||||
"sync_mode": "primary",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
|
||||
multi_save_rgbir_node = Node(
|
||||
package="orbbec_camera",
|
||||
executable="multi_save_rgbir_node",
|
||||
name="multi_save_rgbir_node",
|
||||
left_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "left_camera",
|
||||
"usb_port": "2-3.2",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
right_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "right_camera",
|
||||
"usb_port": "2-3.4",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
rear_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, "gemini_330_series_interleave_laser_g335L.launch.py")
|
||||
),
|
||||
launch_arguments={
|
||||
"camera_name": "rear_camera",
|
||||
"usb_port": "2-2",
|
||||
"device_num": "4",
|
||||
"sync_mode": "secondary_synced",
|
||||
"config_file_path": config_file_path,
|
||||
}.items(),
|
||||
)
|
||||
|
||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
[
|
||||
GroupAction([multi_save_rgbir_node]),
|
||||
TimerAction(
|
||||
period=2.0,
|
||||
actions=[
|
||||
TimerAction(period=0.5, actions=[GroupAction([G1_54])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([G2_5Y])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([G3_47])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([G0_51])]),
|
||||
],
|
||||
),
|
||||
# The primary camera should be launched at last
|
||||
]
|
||||
[
|
||||
TimerAction(period=0.5, actions=[GroupAction([left_camera])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([right_camera])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([rear_camera])]),
|
||||
TimerAction(period=0.5, actions=[GroupAction([front_camera])]),
|
||||
]
|
||||
)
|
||||
|
||||
return ld
|
||||
return ld
|
||||
Reference in New Issue
Block a user