From f2caf59a5c57762f8ffdc289840fbe12e7390403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Tue, 23 Apr 2024 06:28:02 +0200 Subject: [PATCH] [backport humble] Node namespace parameter (#963) Backport pull request #925 which solves issue #952 by adding the `namespace` parameter to the `image_proc` launch file Co-authored-by: Lucas Wendland <82680922+CursedRock17@users.noreply.github.com> --- image_proc/launch/image_proc.launch.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/image_proc/launch/image_proc.launch.py b/image_proc/launch/image_proc.launch.py index 91af35f7f..42626f01a 100644 --- a/image_proc/launch/image_proc.launch.py +++ b/image_proc/launch/image_proc.launch.py @@ -41,16 +41,24 @@ def generate_launch_description(): + + arg_namespace = DeclareLaunchArgument( + name='namespace', default_value='', + description=('namespace for all components loaded') + ) + composable_nodes = [ ComposableNode( package='image_proc', plugin='image_proc::DebayerNode', name='debayer_node', + namespace=LaunchConfiguration('namespace'), ), ComposableNode( package='image_proc', plugin='image_proc::RectifyNode', name='rectify_mono_node', + namespace=LaunchConfiguration('namespace'), # Remap subscribers and publishers remappings=[ ('image', 'image_mono'), @@ -62,6 +70,7 @@ def generate_launch_description(): package='image_proc', plugin='image_proc::RectifyNode', name='rectify_color_node', + namespace=LaunchConfiguration('namespace'), # Remap subscribers and publishers remappings=[ ('image', 'image_color'), @@ -82,7 +91,7 @@ def generate_launch_description(): image_processing_container = ComposableNodeContainer( condition=LaunchConfigurationEquals('container', ''), name='image_proc_container', - namespace='', + namespace=LaunchConfiguration('namespace'), package='rclcpp_components', executable='component_container', composable_node_descriptions=composable_nodes, @@ -98,6 +107,7 @@ def generate_launch_description(): ) return LaunchDescription([ + arg_namespace, arg_container, image_processing_container, load_composable_nodes,