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

how do I use download_test_data()?

asked 2013-05-21 18:32:40 -0600

joq gravatar image

updated 2013-05-23 05:09:41 -0600

I am trying to migrate a rosbuild package to catkin. It has unit tests which require moderately large data files stored on The rosbuild version did it like this:


So, I changed that to invoke download_test_data() with identical parameters.

But, my tests can't find the data. Formerly they did it this way:

<!-- start read with example PCAP file -->
<node pkg="velodyne_driver" type="velodyne_node" name="velodyne_node">
  <param name="model" value="32E"/>
  <param name="pcap" value="$(find velodyne_driver)/tests/32e.pcap"/>

Now it fails:

[FATAL] [1369196347.360283641]: Error opening Velodyne socket dump file.

I finally discovered a download_data_tests_32e.pcap make target. Invoking it explicitly reads the file into the build tree, and similarly for another test file.

Several related questions:

  1. Where is download_test_data() documented?

  2. How do it get the the unit test build targets to depend on the download targets?

  3. What do I use instead of $(find velodyne_driver)/tests/32e.pcap to resolve the path name?

UPDATE: The download command puts the data here in the build tree: ~/ros/wet/hydro/build/velodyne/velodyne_driver/tests/32e.pcap, which seems reasonable.

But, rospack resolves to the source tree:

$ rospack find velodyne_driver 

Is that why $(find velodyne_driver)/tests/32e.pcap does not work?

Also, experiment reveals an answer to question 2: the tests and run_tests build targets do depend on the download targets, but the more specific run_tests_velodyne_driver target does not.

UPDATE2: I tried to hack around the problem by using an absolute file name in /tmp:


But, download_test_data() insists on prefixing the name with ${PROJECT_BINARY_DIR}/, even when it is fully qualified. It always goes in the build tree, although it cannot be resolved there.

edit retag flag offensive close merge delete


There does not appear to be any documentation for this function, but the source is located here:

William gravatar image William  ( 2013-05-22 07:19:52 -0600 )edit

I looked at the source, that's the only way I got as far as I did. But, it's not exactly self-explanatory. I also found other packages doing similar things, presumably successfully.

joq gravatar image joq  ( 2013-05-22 07:25:22 -0600 )edit

Yeah, I figured, but I don't have answers to your other questions yet.

William gravatar image William  ( 2013-05-22 08:36:59 -0600 )edit

OK. Thanks for the help. I'll keep working on it. I want to write a how-to page for this, if I can figure out how. :-)

joq gravatar image joq  ( 2013-05-22 09:04:20 -0600 )edit

That would be appreciated, I'll try to polish this process for 0.4, but as it really affects a small number of users it hasn't been prioritized.

William gravatar image William  ( 2013-05-22 09:07:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-05-23 04:58:10 -0600

joq gravatar image
edit flag offensive delete link more

Question Tools


Asked: 2013-05-21 18:32:40 -0600

Seen: 628 times

Last updated: May 23 '13