-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
download_test_data: not documented and difficult to use #426
Comments
I tried to hack around the problem by using an absolute file name in /tmp.
But, |
The following appalling hack seems to work:
I even had to spell out the package name, because I could not get CMake to resolve |
The CMake variable for the project name is called I don't have a package at hand which does it the way you describe it. Can you try the following (or point me to an existing repo with which I could give it a try)? Since the test data is downloaded to a location relative to |
The package I am trying to port is the velodyne_driver. To see how easily it all worked before, compare the rosbuild branch. I have no idea what "register your test with a WORKING_DIRECTORY which points to PROJECT_BINARY_DIR" means. If you can tell me what to do, I will try it. Since the file is used by rostest, I doubt a relative path name is going to work, however. |
Taking a step back... Any *.test file should be runnable via the Than CMake can perform the download (to whatever location, preferably into build spacce) and pass that information to the rostest via That would cleanly separate the knowledge about the location of the test data to a single location - namely where it is downloaded and that location is passed to rostest. I will look into making this possible with |
I have added the feature to pass arbitrary arguments to
and in your CMake file you pass the location as a standard roslaunch argument:
If you want to give this a try you need to place the latest rostest package (or a complete ros_comm checkout) into your workspace. |
Good idea, Dirk. The ARGS option looks like a generally useful extension. Does it work for .launch files as well as .test files? Where is I can give the new option a try, but won't be able to actually use it until you release a new ros_comm. I am still trying to release the Velodyne driver to Hydro. You probably would not believe how long that is taking me. |
I think I don't get your question right? What do you mean with "does it work for .launch files as well"? The command line tools roslaunch as well as rostest already support passing arguments. The patch only exposes that to the CMake macro You can expect a new release of ros_comm within a couple of days. It has already been quite some time since the last version and several fixes have piled up. I am currently only waiting for some changelog related helper scripts to be finished. |
I found another issue: several Velodyne packages share the same test files. They each end up declaring the same build target name, which CMake does not allow, of course. For now, I am commenting out the downloads in velodyne_pointcloud and using the ones downloaded by velodyne_driver. That is very hackish, and probably will not work with your ARGS solution, since it would need the It would be better for each package to download the files independently, but that would require a package name prefix for the |
Since rostest can use .launch files as well as .test files, I was wondering if their arguments can be passed similarly. I presume they can, but it doesn't hurt to ask. |
I read @wjwwood's explanation of the reasons why downloaded files go in build space and not devel space. I didn't find them very convincing. Wouldn't this work much cleaner if the files were find-able in all the usual ways? Maybe the current command is somewhat hopeless, because too many other packages already work around its quirks. But, a new command or option to store the files in devel space really looks attractive to me. It would make porting from rosbuild much more straightforward. |
The devel space has the disadvantage that these files would be exposed to every package. Imho the test data files should be private to the testing package and not made publicly available. |
I don't really care if it ends up in build or devel space, I was simply trying to figure out from a higher level what would be most correct. Either way the macro needs to create package name-spaced targets and the data needs to be easily discoverable, I am just not sure what the best solution for that is yet. |
But, don't forget my earlier note about several packages sharing the same works in a large catkin work-space, which is not currently the case.joq |
I have created a pull request which implements a cleaner CMake function for downloading test data. I enables all use cases mentioned in this thread (as far as I can see) by allowing custom download destinations / filenames. The signature also exposes the target name. Please feel to give it a try and comment on the pull request #431. |
Looks good. I'll try it. Thanks, Dirk. |
Should be addressed by #431. |
There is no documentation for this command.
I am converting a rosbuild package to catkin. It used
rosbuild_download_test_data()
, which I changed todownload_test_data()
.The file gets downloaded to the build tree, but in rostest
$(find PACKAGE)/tests/FILENAME.pcap
can't find it there.See this question for details, also the discussion in #416.
The text was updated successfully, but these errors were encountered: