launch_ros.substitutions package

Submodules

Module contents

substitutions Module.

class launch_ros.substitutions.ExecutableInPackage(*args: Any, **kwargs: Any)

Bases: FindPackagePrefix

Substitution that tries to locate an executable in the libexec directory of a ROS package.

The ROS package is located using ament_index_python.

Raise:

ament_index_python.packages.PackageNotFoundError when package is not found during substitution

Raise:

SubstitutionFailure when executable is not found, or package libexec directory doesn’t exist, during substitution

describe() str

Return a description of this substitution as a string.

property executable: List[launch.substitution.Substitution]

Getter for executable.

classmethod parse(data: Sequence[launch.some_substitutions_type.SomeSubstitutionsType])

Parse a ExecutableInPackage substitution.

perform(context: launch.launch_context.LaunchContext) str

Perform the substitution by locating the executable.

class launch_ros.substitutions.FindPackage(*args: Any, **kwargs: Any)

Bases: Substitution

Abstract base class for substitutions involving finding a package.

Subclasses should implement the find() method.

describe() str

Return a description of this substitution as a string.

find(package_name: str) str

Find a directory for a package.

Called when the substitution is performed.

Param:

package_name The name of the package.

Returns:

A directory related to the package.

property package: List[launch.substitution.Substitution]

Getter for package.

classmethod parse(data: Sequence[launch.some_substitutions_type.SomeSubstitutionsType])

Parse a FindPackage substitution.

perform(context: launch.launch_context.LaunchContext) str

Perform the substitution by locating the package.

class launch_ros.substitutions.FindPackagePrefix(*args: Any, **kwargs: Any)

Bases: FindPackage

Substitution that tries to locate the package prefix of a ROS package.

The ROS package is located using ament_index_python.

Raise:

ament_index_python.packages.PackageNotFoundError when package is not found during substitution.

find(package_name: str) str

Find the package prefix.

class launch_ros.substitutions.FindPackageShare(*args: Any, **kwargs: Any)

Bases: FindPackage

Substitution that tries to locate the share directory of a ROS package.

The directory is located using ament_index_python.

Raise:

ament_index_python.packages.PackageNotFoundError when package is not found during substitution.

find(package_name: str) str

Find the share directory of a package.

class launch_ros.substitutions.Parameter(*args: Any, **kwargs: Any)

Bases: Substitution

Substitution that tries to get a parameter that was set by SetParameter.

Raise:

SubstitutionFailure when param is not found

describe() str

Return a description of this substitution as a string.

property name: List[launch.substitution.Substitution]

Getter for name.

classmethod parse(data: Sequence[launch.some_substitutions_type.SomeSubstitutionsType])

Parse a Parameter substitution.

perform(context: launch.launch_context.LaunchContext) str

Perform the substitution.