launch_ros.substitutions.find_package module

Module for the FindPackage substitution.

class launch_ros.substitutions.find_package.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.find_package.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.find_package.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.

launch_ros.substitutions.find_package.expose_substitution(_)