Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you download the file you can specify any location where you want it to be stored. E.g. when using catkin_download_test_data you could pass ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION} as the DESTINATION in order to place the downloaded file in the devel space under share/YOUR-PKG-NAME.

(Your CMake function to register new downloads should enable to specify a user defined target name for each download in order to be able to declare dependencies between targets.)

To find the resources in a scenario with a devel and source space you can't use the ros::package API. It does not know about the new workspace layout. Instead you have to options:

  • you can use catkin_find (as a command line tool, which has various options to tailor your search criteria) or the Python API from catkin.find_in_workspaces to dynamically resolve the location of the resources

  • or you could pass the known location from within CMake to your code via a configuration file, embed the location into your code (using configure_file) or an environment variable (as you did it before).

(Please consider that it might be considered bad habit if a user checks out your package into a workspace but is then unable to build the workspace without further internet connectivity.)