Ask Your Question

Revision history [back]

To access the share directory of a package in a generic way you can use the ament index. In particular, get_package_share_directory from ament_index_python, or from ament_index_cpp might be what you're looking for.

There are other useful things that can be done with the ament index, for example the composition demo package "registers" node components in the ament index and then looks up the available node components at run-time without recursively crawling the file system. The ament index docs have more info on the design.

Hope that helps!