launch.substitutions.this_launch_file module

Module for the ThisLaunchFile substitution.

class launch.substitutions.this_launch_file.ThisLaunchFile[source]

Bases: Substitution

Substitution that returns the absolute path to the current launch file.

__init__() None[source]

Create a ThisLaunchFile substitution.

describe() str[source]

Return a description of this substitution as a string.

classmethod parse(data: Sequence[str | Path | Substitution | Iterable[str | Path | Substitution]])[source]

Parse ThisLaunchFile substitution.

perform(context: LaunchContext) str[source]

Perform the substitution by returning the path to the current launch file.

If there is no current launch file, i.e. if run from a script, then an error is raised.

Raises:

SubstitutionFailure if not in a launch file