diff --git a/launch_ros/launch_ros/actions/node.py b/launch_ros/launch_ros/actions/node.py index aa03d751..001a4ba9 100644 --- a/launch_ros/launch_ros/actions/node.py +++ b/launch_ros/launch_ros/actions/node.py @@ -400,7 +400,7 @@ def _perform_substitutions(self, context: LaunchContext) -> None: if self.__node_namespace is not None: expanded_node_namespace = perform_substitutions( context, normalize_to_list_of_substitutions(self.__node_namespace)) - base_ns = context.launch_configurations.get('ros_namespace', None) + base_ns = context.get_locals_as_dict().get('ros_namespace', None) expanded_node_namespace = make_namespace_absolute( prefix_namespace(base_ns, expanded_node_namespace)) if expanded_node_namespace is not None: @@ -468,7 +468,7 @@ def _perform_substitutions(self, context: LaunchContext) -> None: cmd_extension = ['--params-file' if is_file else '-p', f'{param_argument}'] self.cmd.extend([normalize_to_list_of_substitutions(x) for x in cmd_extension]) # expand remappings too - global_remaps = context.launch_configurations.get('ros_remaps', None) + global_remaps = context.get_locals_as_dict().get('ros_remaps', None) if global_remaps or self.__remappings: self.__expanded_remappings = [] if global_remaps: diff --git a/launch_ros/launch_ros/actions/push_ros_namespace.py b/launch_ros/launch_ros/actions/push_ros_namespace.py index ad53d027..330e5be3 100644 --- a/launch_ros/launch_ros/actions/push_ros_namespace.py +++ b/launch_ros/launch_ros/actions/push_ros_namespace.py @@ -67,7 +67,7 @@ def namespace(self) -> List[Substitution]: def execute(self, context: LaunchContext): """Execute the action.""" pushed_namespace = perform_substitutions(context, self.namespace) - previous_namespace = context.launch_configurations.get('ros_namespace', None) + previous_namespace = context.get_locals_as_dict().get('ros_namespace', None) namespace = make_namespace_absolute( prefix_namespace(previous_namespace, pushed_namespace)) try: @@ -79,4 +79,4 @@ def execute(self, context: LaunchContext): previous_namespace, pushed_namespace ) ) - context.launch_configurations['ros_namespace'] = namespace + context.extend_locals({'ros_namespace': namespace}) diff --git a/launch_ros/launch_ros/actions/set_remap.py b/launch_ros/launch_ros/actions/set_remap.py index 1fb26c6e..2d02a83d 100644 --- a/launch_ros/launch_ros/actions/set_remap.py +++ b/launch_ros/launch_ros/actions/set_remap.py @@ -88,6 +88,6 @@ def execute(self, context: LaunchContext): """Execute the action.""" src = perform_substitutions(context, self.__src) dst = perform_substitutions(context, self.__dst) - global_remaps = context.launch_configurations.get('ros_remaps', []) + global_remaps = context.get_locals_as_dict().get('ros_remaps', []) global_remaps.append((src, dst)) - context.launch_configurations['ros_remaps'] = global_remaps + context.extend_locals({'ros_remaps': global_remaps})