ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You would need to install that file somehow (maybe using package_data in the setup.py, see: https://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=data_files#including-data-files), or using the install() macro if you're using CMake.

Since this is Python, you can try to access these files at runtime using:

https://setuptools.readthedocs.io/en/latest/pkg_resources.html

Or if you installed them and want to use ROS to find the files at runtime, you can use the "ament_index" to locate the package's installation directory and find the file relatively from there, see:

https://answers.ros.org/question/288501/ros2-equivalent-of-rospackagegetpath/?answer=288521#post-id-288521