Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of -r/--remap flags where appropriate. #59

Merged
merged 2 commits into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions launch_ros/launch_ros/actions/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -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.append(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(
Expand Down