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

Accessing data downloaded via catkin_download_test_data

asked 2017-02-03 17:02:49 -0600

130s gravatar image

updated 2017-02-13 17:58:45 -0600

Catkin's document "Downloading test data" recommends to specify the location to store the downloaded data by DESTINATION option in catkin_download_test_data macro, so that the data can be accessed in roslaunch by $(find your_package) during the tests.

While using CATKIN_DEVEL_PREFIX in DESTINATION certainly downloads the data at the intended location under devel folder, however, in the workspaces built by normal ways (e.g. catkin_make, catkin build with limited options etc.), rospack find looks for the specified package under src instead of devel AFAIK, which results in the test not being able to find the downloaded data.

Is there a way to access the data without changing much of workspace build process?

I'm pretty sure the catkin doc above is using velodyne package as an example, where the tests successfully access the downloaded data by a chain of complicated catkin_make_isolated commands, which is not ideal in my case.

UPDATE1. Is catkin run_tests not enough to run test target? That's what I do in this PR (build script is here) and fails (e.g. here saying the file is not found).

UPDATE2. I conclude in the end that the way mentioned in Catkin's doc I referenced at the top should work as expected. In my very own case, rospack had not been able to find the downloaded file simply because there was a typo in the path name :/

edit retag flag offensive close merge delete



I don't think it is enough to say just catkin run_tests. Instead you can try catkin build and then catkin run_tests. It could also be that your test targets do not depend on the download target, so the file is not downloaded by make before trying to run the test.

William gravatar image William  ( 2017-02-06 22:45:25 -0600 )edit

3 Answers

Sort by » oldest newest most voted

answered 2017-02-03 17:36:12 -0600

William gravatar image

It should work, see:

roslaunch should look in both the source and devel spaces in this case. The "chain of complicated catkin_make_isolated commands" is simply building in three separate steps. The first one builds everything but tests (the "all" target in make), the second one ensures the tests are built (the "tests" target in make), and the third runs the tests. I would expect you could just do that last one. I think you might be conflating the two items: find the file and how you're building your workspace. You will have to manually run the test targets as they are not part of the "all" target.

edit flag offensive delete link more

answered 2017-02-13 15:27:54 -0600

Mathias Lüdtke gravatar image

updated 2017-02-13 15:39:23 -0600

Have you tried to download it to ${CATKIN_PACKAGE_SHARE_DESTINATION}/test? Update: just evaluates to share, so it might not help.

edit flag offensive delete link more

answered 2017-02-06 22:20:35 -0600

130s gravatar image

In my usecase I only need the download during test. Apparently with CMAKE_CURRENT_SOURCE_DIR the downloaded file goes into source dir and rospack can access it. (Concrete example.)

edit flag offensive delete link more



This is not a good general solution, as it causes files to be added or modified in the source space. There is an ideal in catkin that the source space should be treated as read only. In this particular case it's probably fine (since it's not build configuration specific) but ideally you'd use devel.

William gravatar image William  ( 2017-02-06 22:42:11 -0600 )edit

Question Tools



Asked: 2017-02-03 17:02:49 -0600

Seen: 381 times

Last updated: Feb 13 '17