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

Accessing data downloaded via catkin_download_test_data

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

130s gravatar image

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

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

Comments

1

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 -0500 )edit

3 Answers

Sort by » oldest newest most voted
0

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

William gravatar image

It should work, see:

https://github.com/ros/ros_comm/pull/228 https://github.com/ros/xacro/issues/141

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
1

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

Mathias Lüdtke gravatar image

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

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
0

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

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

Comments

2

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 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 414 times

Last updated: Feb 13 '17