Repository: ros/ros_comm

Issue:
roslaunch dependency check test looks in manifest.xml for dependency
The `roslaunch_add_file_check` macro complains about missing dependency in manifest.xml file.  It's not clear if the script is looking for the manifest.xml file (in which case it would fail under catkin) or if the dependency is truly missing (which I don't think it is).

The following steps reproduce the problem:
1. Clone the repo:
   `git clone https://github.com/shaun-edwards/industrial_core.git`
   `git checkout rosi_issue_11_launch_test`
2. Make/run the tests:
   `catkin_make run_tests_industrial_robot_simulator`

Resulting output:

```
-- run_tests.py: execute commands
  /usr/bin/cmake -E make_directory /home/ros/ros/release/build/test_results/industrial_robot_simulator
  /opt/ros/hydro/share/roslaunch/cmake/../scripts/roslaunch-check -o /home/ros/ros/release/build/test_results/industrial_robot_simulator/roslaunch-check_launch.xml /home/ros/ros/release/src/industrial_core/industrial_robot_simulator/launch 
checking *.launch in directory /home/ros/ros/release/src/industrial_core/industrial_robot_simulator/launch
checking /home/ros/ros/release/src/industrial_core/industrial_robot_simulator/launch/robot_interface_simulator.launch
...writing test results to /home/ros/ros/release/build/test_results/industrial_robot_simulator/roslaunch-check_launch.xml
FAILURE:
[/home/ros/ros/release/src/industrial_core/industrial_robot_simulator/launch/robot_interface_simulator.launch]:
    Missing manifest dependencies: industrial_robot_simulator/manifest.xml: industrial_robot_client
wrote test file to [/home/ros/ros/release/build/test_results/industrial_robot_simulator/roslaunch-check_launch.xml]
-- run_tests.py: verify result "/home/ros/ros/release/build/test_results/industrial_robot_simulator/roslaunch-check_launch.xml"
```

The test was added to CMakeLists.txt:

```
<snip>
find_package(roslaunch)
roslaunch_add_file_check(launch)
<snip>
```

The package xml has the following depends:

```
<build_depend>industrial_robot_client</build_depend>
<run_depend>industrial_robot_client</run_depend>
```

This appears to be a bug in the roslaunch test macros.



Discussion:
Seems adding a dummy `manifest.xml` to `industrial_robot_simulator` containing just:

```
<package>
  <depend package="industrial_robot_client" />
</package>
```

makes the test pass.


Resolving patch:
diff --git a/tools/roslaunch/src/roslaunch/depends.py b/tools/roslaunch/src/roslaunch/depends.py
--- a/tools/roslaunch/src/roslaunch/depends.py
+++ b/tools/roslaunch/src/roslaunch/depends.py
@@ -263,6 +263,13 @@ def calculate_missing(base_pkg, missing, file_deps):
             continue
         m = rospack.get_manifest(pkg)
         d_pkgs = set([d.name for d in m.depends])
+        if m.is_catkin:
+            # for catkin packages consider the run dependencies instead
+            # else not released packages will not appear in the dependency list
+            # since rospkg  does uses rosdep to decide which dependencies to return
+            from catkin_pkg.package import parse_package
+            p = parse_package(os.path.dirname(m.filename))
+            d_pkgs = set([d.name for d in p.run_depends])
         # make sure we don't count ourselves as a dep
         d_pkgs.add(pkg)
 


Test patch: