launch.substitutions.this_launch_file_dir module

Module for the ThisLaunchFileDir substitution.

class launch.substitutions.this_launch_file_dir.ThisLaunchFileDir[source]

Bases: PathSubstitution

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

__init__() None[source]

Create a ThisLaunchFileDir 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 ThisLaunchFileDir 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:

launch.substitutions.substitution_failure.SubstitutionFailure – if not in a launch file