Use the dev_matrices parameter to pass arguments

This commit is contained in:
datean
2024-12-23 20:59:35 +08:00
parent 8f1410726e
commit 629849a345
2 changed files with 9 additions and 8 deletions
@@ -9,6 +9,7 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration from launch.substitutions import LaunchConfiguration
from launch.actions import TimerAction from launch.actions import TimerAction
from launch.actions import GroupAction from launch.actions import GroupAction
from launch.substitutions import PathJoinSubstitution
def generate_launch_description(): def generate_launch_description():
orbbec_camera_bringup_dir = get_package_share_directory('orbbec_camera') orbbec_camera_bringup_dir = get_package_share_directory('orbbec_camera')
@@ -50,9 +51,6 @@ def generate_launch_description():
'component_container_name': component_container_name_arg}.items(), 'component_container_name': component_container_name_arg}.items(),
condition=UnlessCondition(LaunchConfiguration('from_bag'))) condition=UnlessCondition(LaunchConfiguration('from_bag')))
dev_matrices_arg = DeclareLaunchArgument(
'dev_matrices', default_value=default_dev_matrices_file,
description='default device extrinsics matrices')
base_static_transforms_publisher = ExecuteProcess( base_static_transforms_publisher = ExecuteProcess(
cmd=[ cmd=[
'python3', 'python3',
@@ -61,7 +59,10 @@ def generate_launch_description():
'launch', 'launch',
'base_static_transforms_publisher.py' 'base_static_transforms_publisher.py'
), ),
'--dev_matrices', LaunchConfiguration('dev_matrices') '--dev_matrices', PathJoinSubstitution([
get_package_share_directory('isaac_orbbec_launch'),
LaunchConfiguration('dev_matrices')
])
], ],
output='screen' output='screen'
) )
@@ -100,10 +101,10 @@ def generate_launch_description():
from_bag_arg, from_bag_arg,
bag_path_arg, bag_path_arg,
shared_orbbec_container, shared_orbbec_container,
orbbec_launch, # orbbec_launch,
base_static_transforms_publisher, base_static_transforms_publisher,
perceptor_launch, # perceptor_launch,
bag_play, # bag_play,
rviz2_node, # rviz2_node,
] ]
) )