From d10cb9ed675c6dbaf018dff632573376a5d22b26 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Wed, 28 Aug 2019 17:38:20 -0300 Subject: [PATCH 1/2] Use of -r/--remap flags where appropriate. Signed-off-by: Michel Hidalgo --- launch_ros/launch_ros/actions/node.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/launch_ros/launch_ros/actions/node.py b/launch_ros/launch_ros/actions/node.py index f9c1c2bd..543313a4 100644 --- a/launch_ros/launch_ros/actions/node.py +++ b/launch_ros/launch_ros/actions/node.py @@ -131,7 +131,7 @@ def __init__( # The substitutions will get expanded when the action is executed. cmd += ['--ros-args'] # Prepend ros specific arguments with --ros-args flag if node_name is not None: - cmd += [LocalSubstitution( + cmd += ['-r', LocalSubstitution( "ros_specific_arguments['name']", description='node name')] if parameters is not None: ensure_argument_type(parameters, (list), 'parameters', 'Node') @@ -148,7 +148,7 @@ def __init__( i = 0 for remapping in normalize_remap_rules(remappings): k, v = remapping - cmd += [LocalSubstitution( + cmd += ['-r', LocalSubstitution( "ros_specific_arguments['remaps'][{}]".format(i), description='remapping {}'.format(i))] i += 1 @@ -290,9 +290,9 @@ def _perform_substitutions(self, context: LaunchContext) -> None: ): self.__expanded_node_namespace = '/' + self.__expanded_node_namespace if self.__expanded_node_namespace != '': - self.cmd.append(normalize_to_list_of_substitutions([ + self.cmd.extend(['-r', normalize_to_list_of_substitutions([ LocalSubstitution("ros_specific_arguments['ns']") - ])) + ])]) validate_namespace(self.__expanded_node_namespace) except Exception: self.__logger.error( From 3175a71f8dfb3bd030668175c82bc36604bda95a Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Mon, 2 Sep 2019 12:02:44 -0300 Subject: [PATCH 2/2] Fix bad -r flag use as cmd substitution. Signed-off-by: Michel Hidalgo --- launch_ros/launch_ros/actions/node.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/launch_ros/launch_ros/actions/node.py b/launch_ros/launch_ros/actions/node.py index 543313a4..5b27b72d 100644 --- a/launch_ros/launch_ros/actions/node.py +++ b/launch_ros/launch_ros/actions/node.py @@ -290,9 +290,8 @@ def _perform_substitutions(self, context: LaunchContext) -> None: ): self.__expanded_node_namespace = '/' + self.__expanded_node_namespace if self.__expanded_node_namespace != '': - self.cmd.extend(['-r', normalize_to_list_of_substitutions([ - LocalSubstitution("ros_specific_arguments['ns']") - ])]) + cmd_extension = ['-r', LocalSubstitution("ros_specific_arguments['ns']")] + self.cmd.extend([normalize_to_list_of_substitutions(x) for x in cmd_extension]) validate_namespace(self.__expanded_node_namespace) except Exception: self.__logger.error(