diff --git a/launch_ros/launch_ros/actions/node.py b/launch_ros/launch_ros/actions/node.py index 315ce095..af9d7325 100644 --- a/launch_ros/launch_ros/actions/node.py +++ b/launch_ros/launch_ros/actions/node.py @@ -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 diff --git a/test_launch_ros/test/test_launch_ros/actions/test_node.py b/test_launch_ros/test/test_launch_ros/actions/test_node.py index 8b8beaa4..910033a6 100644 --- a/test_launch_ros/test/test_launch_ros/actions/test_node.py +++ b/test_launch_ros/test/test_launch_ros/actions/test_node.py @@ -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',