Function ament_index_cpp::is_resource_available

Function Documentation

std::optional<std::filesystem::path> ament_index_cpp::is_resource_available(const std::string &resource_type, const std::string &resource_name)

Check if resource exists and get its path.

Parameters:
  • resource_type[in] type of the resource

  • resource_name[in] name of the resource

Returns:

the installation prefix of the given resource if found or std::nullopt otherwise. Returns std::nullopt (does not throw) if resource_type or resource_name are empty.