launch.launch_description_sources.python_launch_description_source module

Module for the PythonLaunchDescriptionSource class.

class launch.launch_description_sources.python_launch_description_source.PythonLaunchDescriptionSource[source]

Bases: LaunchDescriptionSource

Encapsulation of a Python launch file, which can be loaded during launch.

__init__(launch_file_path: str | Substitution | Iterable[str | Substitution]) None[source]

Create a PythonLaunchDescriptionSource.

The given file path should be to a .launch.py style file. The path should probably be absolute, since the current working directory will be wherever the launch file was run from, which might change depending on the situation. The path can be made up of Substitution instances which are expanded when get_launch_description() is called.

See also get_launch_description_from_python_launch_file().

Parameters:

launch_file_path – the path to the launch file