From f5671d31e32f0aa72c182c4590c072212fd74fb6 Mon Sep 17 00:00:00 2001 From: Mukunda Bharatheesha Date: Fri, 13 Dec 2024 22:53:41 +0100 Subject: [PATCH] Append ros namespace to target container if available. Signed-off-by: Mukunda Bharatheesha --- launch_ros/launch_ros/actions/load_composable_nodes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/launch_ros/launch_ros/actions/load_composable_nodes.py b/launch_ros/launch_ros/actions/load_composable_nodes.py index 6ab36f7f..46c1a0d9 100644 --- a/launch_ros/launch_ros/actions/load_composable_nodes.py +++ b/launch_ros/launch_ros/actions/load_composable_nodes.py @@ -220,6 +220,13 @@ def execute( 'target container is neither a ComposableNodeContainer nor a SubstitutionType') return + # Check if a global ros_namespace has been set with push ros namespace. + base_ns = context.launch_configurations.get('ros_namespace', None) + if base_ns is not None: + self.__final_target_container_name = make_namespace_absolute( + prefix_namespace(base_ns, self.__final_target_container_name) + ) + # Create a client to load nodes in the target container. self.__rclpy_load_node_client = get_ros_node(context).create_client( composition_interfaces.srv.LoadNode, '{}/_container/load_node'.format(