Skip to content

Commit

Permalink
Add node prefix to command line remaps
Browse files Browse the repository at this point in the history
Distro A; OPSEC #4584

Signed-off-by: Roger Strain <[email protected]>
  • Loading branch information
Roger Strain committed Mar 26, 2021
1 parent 2e498f1 commit a68f1d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions launch_ros/launch_ros/descriptions/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _create_params_file_from_dict(self, params):

def _get_parameter_rule(self, param: 'Parameter', context: LaunchContext):
name, value = param.evaluate(context)
return f'{name}:={yaml.dump(value)}'
return f'{self.__expanded_node_name}:{name}:={yaml.dump(value)}'

def prepare(self, context: LaunchContext, executable: Executable, action: Action) -> None:
self._perform_substitutions(context, executable.cmd)
Expand Down Expand Up @@ -316,7 +316,7 @@ def _perform_substitutions(self, context: LaunchContext, cmd: List) -> None:
if self.__expanded_remappings:
cmd_ext = []
for src, dst in self.__expanded_remappings:
cmd_ext.extend(['-r', f'{src}:={dst}'])
cmd_ext.extend(['-r', f'{self.__expanded_node_name}:{src}:={dst}'])
cmd.extend([normalize_to_list_of_substitutions(x) for x in cmd_ext])
# Prepare the ros_specific_arguments list and add it to the context so that the
# LocalSubstitution placeholders added to the the cmd can be expanded using the contents.
Expand Down

0 comments on commit a68f1d8

Please sign in to comment.