35 from typing
import List, Optional
41 from tempfile
import NamedTemporaryFile
45 with NamedTemporaryFile(mode=
"w", prefix=
"launch_params_", delete=
False)
as h:
46 param_file_path = h.name
47 param_dict = {node_name: {
"ros__parameters": params}}
48 yaml.dump(param_dict, h, default_flow_style=
False)
49 return param_file_path
54 A utility that returns the path value after the --params-file arguments.
60 indexes = [i
for i, v
in enumerate(cli_args)
if v ==
"--params-file"]
61 return [cli_args[i + 1]
for i
in indexes]
64 "Failed to parse params file paths from command line arguments. Check that --params-file command line argument is specified."
List[str] get_launch_params_filepaths(Optional[List[str]] cli_args=None)
def create_params_file_from_dict(params, node_name)