ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

roslaunch_add_file_check(..) and build dependencies

asked 2014-02-03 03:26:47 -0600

gvdhoorn gravatar image

Having added a roslaunch_add_file_check(..) to my CMakeLists.txt, I notice that if the tests are invoked as:

catkin_make run_tests_my_package

in a clean workspace (ie: no build or devel directories present), all tests that include launchfiles that start compiled nodes fail. catkin immediately tries to execute the tests, without first compiling the package, or any of its dependencies. Example console output:

#### Running command: "make run_tests_my_package -j1" in "/home/user/ros/catkin_ws/build"
-- execute commands
  /usr/bin/cmake -E make_directory /home/user/ros/catkin_ws/build/test_results/my_package
  /opt/ros/hydro/share/roslaunch/cmake/../scripts/roslaunch-check -o /home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml /home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.xml 
checking /home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.xml
...writing test results to /home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml
    cannot find node [compiled_node_a] in package [some_other_package]
cannot find node [compiled_node_b] in package [my_package]
cannot find node [compiled_node_c] in package [my_package]
wrote test file to [/home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml]
-- verify result "/home/user/ros/catkin_ws/build/test_results/my_package/roslaunch-check_tests_roslaunch_test.xml.xml"
Built target run_tests_my_package_roslaunch-check_tests_roslaunch_test.xml
Built target run_tests_my_package_roslaunch-check
Built target run_tests_my_package

my_package has both run and build depends on some_other_package in its package.xml. And roslaunch is a build_depend of my_package.

I've tried using add_dependencies(..), but couldn't find a working target. It would also mean I'd have to manually make all targets dependencies of my roslaunch test. Is there a way to make the roslaunch tests only run after all other targets have been built?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-03 04:05:39 -0600

Dirk Thomas gravatar image

The next roslaunch version (1.9.55) will allow you to specify the option keyword DEPENDENCIES when invoking roslaunch_add_file_check() followed by a list of target names which must be built before the test is run.

Until then you must manually build all targets necessary (or just build the whole workspace).

edit flag offensive delete link more


If a target local to my pkg is added to the DEPENDENCIES, and my pkg (build)depends on another pkg, will the targets in my dependencies also be build first? In other words: are the dependencies recursive?

gvdhoorn gravatar image gvdhoorn  ( 2014-02-03 05:08:55 -0600 )edit

Build dependencies from the package.xml file do not map to CMake target dependencies automatically since they are very different. If you want to depend on all target packages you depend on are exporting use the catkin_EXPORTED_TARGETS variable as an argument. Those are usually used for targets which generate message header etc.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-02-04 01:02:42 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-03 03:26:47 -0600

Seen: 842 times

Last updated: Feb 03 '14