Skip to content

Commit 6c1f36a

Browse files
authored
Avoid using a wildcard to specify parameters if possible (#154)
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
1 parent 3775aa3 commit 6c1f36a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

launch_ros/launch_ros/actions/node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ def is_node_name_fully_specified(self):
331331
def _create_params_file_from_dict(self, params):
332332
with NamedTemporaryFile(mode='w', prefix='launch_params_', delete=False) as h:
333333
param_file_path = h.name
334-
# TODO(dhood): clean up generated parameter files.
335-
param_dict = {'/**': {'ros__parameters': params}}
334+
param_dict = {
335+
self.node_name if self.is_node_name_fully_specified() else '/**':
336+
{'ros__parameters': params}
337+
}
336338
yaml.dump(param_dict, h, default_flow_style=False)
337339
return param_file_path
338340

test_launch_ros/test/test_launch_ros/actions/test_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_launch_node_with_parameter_dict(self):
165165
with open(expanded_parameter_files[0], 'r') as h:
166166
expanded_parameters_dict = yaml.load(h, Loader=yaml.FullLoader)
167167
assert expanded_parameters_dict == {
168-
'/**': {
168+
'/my_ns/my_node': {
169169
'ros__parameters': {
170170
'param1': 'param1_value',
171171
'param2': 'param2_value',

0 commit comments

Comments
 (0)