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

roslaunch_add_file_check(..) and build dependencies

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

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"
####
-- run_tests.py: 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
FAILURE:
[/home/user/ros/catkin_ws/src/my_repo/my_package/tests/roslaunch_test.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]
-- run_tests.py: 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
2

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

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

Comments

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

Question Tools

1 follower

Stats

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

Seen: 907 times

Last updated: Feb 03 '14