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

Avoid passing parameters using a wildcard if fully qualified node name is known at launch time #154

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions launch_ros/launch_ros/actions/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,10 @@ def is_node_name_fully_specified(self):
def _create_params_file_from_dict(self, params):
with NamedTemporaryFile(mode='w', prefix='launch_params_', delete=False) as h:
param_file_path = h.name
# TODO(dhood): clean up generated parameter files.
param_dict = {'/**': {'ros__parameters': params}}
param_dict = {
self.node_name if self.is_node_name_fully_specified() else '/**':
{'ros__parameters': params}
}
yaml.dump(param_dict, h, default_flow_style=False)
return param_file_path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_launch_node_with_parameter_dict(self):
with open(expanded_parameter_files[0], 'r') as h:
expanded_parameters_dict = yaml.load(h, Loader=yaml.FullLoader)
assert expanded_parameters_dict == {
'/**': {
'/my_ns/my_node': {
'ros__parameters': {
'param1': 'param1_value',
'param2': 'param2_value',
Expand Down