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

Help understanding system and package dependencies with rosbuild and catkin

asked 2013-09-28 17:07:05 -0500

I have installed ros-hydro-desktop-full and a few other packages on Ubuntu 12.04. The package ros-hydro-urdf is installed, but the package ros-hydro-cmake-modules is not. The urdf package has a <build_depend>cmake_modules</build_depend> entry in its package.xml file.

I am trying to understand how "rosdep check" and "rospack depends" behave with the various types of dependencies available in rosbuild and catkin packages, and how these dependencies are related to the dependencies between debian packages in Ubuntu. I have performed the following tests, which have given rise to several questions.

Test 1: catkin package with <build_depend>cmake_modules</build_depend>

  # rosdep check: detects dependency
  $ rosdep check example_package
  System dependencies have not been satisified:
  apt   ros-hydro-cmake-modules

  # rospack depends: misses dependency
  $ rospack depends example_package
  (nothing)
  • Question 1a: Why doesn't rospack detect this dependency?
  • Question 1b: Does rospack only care about <run_depend> entries for catkin packages?
  • Question 1c: Is rospack supposed to work properly with catkin packages?

Test 2: catkin package with <run_depend>cmake_modules</run_depend>

  # rosdep check: detects dependency
  $ rosdep check example_package
  System dependencies have not been satisified:
  apt   ros-hydro-cmake-modules

  # rospack depends: generates error
  $ rospack depends example_package
  [rospack] Error: package/stack 'example_package' depends on non-existent package 'cmake_modules' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update'
  • Question 2a: Why does rospack not detect this dependency?
  • Question 2b: Why does rospack generate an error?
  • Question 2c: Why does rospack say that rosdep does not recognise cmake_modules as a system dependency? It is included in the rosdep definitions.

Test 3: catkin package with <build_depend>urdf</build_depend>

  # rosdep check: fails (misses dependency)
  $ rosdep check example_package
  All system dependencies have been satisified

  # rospack depends: misses dependency
  $ rospack depends example_package
  (nothing)
  • Question 3: Shouldn't both rosdep and rospack handle such recursive dependencies? The urdf package depends on the cmake_modules package.

Test 4: catkin package with <run_depend>urdf</run_depend>

  # rosdep check: misses dependency
  $ rosdep check example_package
  All system dependencies have been satisified

  # rospack depends: misses dependency
  $ rospack depends example_package | grep cmake_modules
  (nothing)

Test 5: rosbuild package with <rosdep name="cmake_modules" />

  # rosdep check: detects dependency
  $ rosdep check example_package
  System dependencies have not been satisified:
  apt   ros-hydro-cmake-modules

  # rospack depends: misses dependency
  $ rospack depends example_package
  (nothing)

Test 6: rosbuild package with <depend package="cmake_modules" />

  # rosdep check: misses dependency and generates error
  $ rosdep check example_package
  All system dependencies have been satisified
  ERROR[example_package]: resource not found [cmake_modules]

  # rospack depends: generates error
  $ rospack depends example_package
  [rospack] Error: package/stack 'example_package' depends on non-existent package 'cmake_modules' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update'
  • Question 6a: Why do rosdep and rospack fail? Isn't cmake_modules a ROS package, which one should be able to specify as a package dependency?
  • Question 6b: What does rosdep's "resource not found" error mean?

Test 7: rosbuild package with <rosdep name="urdf" />

  # rosdep check: misses dependency
  $ rosdep check example_package
  All system dependencies have been satisified

  # rospack depends: misses dependency
  $ rospack depends example_package
  (nothing)

Test 8: rosbuild package with <depend package="urdf ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
12

answered 2013-09-28 17:29:48 -0500

Dirk Thomas gravatar image

updated 2013-09-28 18:22:35 -0500

I want to clarify the terms first:

Based on that I will first answer your questions 9a and 9b since they will be the foundation for understanding how dependencies of ROS packages map to Debian packages.

Only the run dependencies are used for the dependencies of the Debian packages. Since ros-hydro-urdf does not need ros-hydro-cmake-modules at runtime (but only at build time) it does not declare a run dependency on it. Therefore the Debian package ros-hydro-urdf does not depend on ros-hydro-cmake-modules which result in ros-hydro-cmake-modules not being installed automatically.

Short answers:

9a: Because the urdf package has no run dependency on cmake_modules.

9b: Yes, on the run dependencies are mapped to Debian dependencies.


The next topic will be rosdep:

Since system dependencies are named very differently on various platforms the rosdep database (stored in these files: https://github.com/ros/rosdistro/tree/master/rosdep) defines a mapping of names (called rosdep keys) to platform specific package names. For dependencies only these rosdep keys are used. In many cases they map 1to1 to Ubuntu packages names.

Besides these system packages there is also a known list of ROS packages. For wet the packages are listed in the rosdistro release file (https://github.com/ros/rosdistro/blob/master/hydro/release.yaml), for dry stacks were the unit of packaging and they are listed in the equivalent legacy release file (https://code.google.com/p/ros-dry-releases/source/browse/trunk/distros/groovy.rosdistro#210). [Hydro does not have any released dry packages anymore.]

Now to the answer of question 9c:

For wet packages dependencies on system packages and ROS packages are not specified differently. The tools will automatically figure out of the name is a ROS package or a rosdep key. For dry packages system dependencies are specified using the rosdep tag and dependencies on other ROS packages with the depend tag. For dry packages both type of dependencies - rosdep as well as depend - are used for the Debian packages - they do not differentiate between build and run dependencies. [E.g. for ROS packages the Debian package name starts with ros-DISTRO- which will automatically be added during the release process.]


Test 1

rospack needs to provide the necessary information to enable building dry packages on top of wet packages. Since the dry and wet world have very different concepts rospack does not look very consistent in its behavior. But most of it is necessary to provide support for building dry packages.

1b: Yes, rospack does only traverse the run dependencies.

Why is that the case. E.g. a dry package D depends on a wet package W. W itself build depends on Wb and run ... (more)

edit flag offensive delete link more

Comments

Thanks for the thorough and quick response! Most of this confirms my suspicions, but I just couldn't wrap my mind around some of the things I was seeing compared to what I expected based on the documentation.

leblanc_kevin gravatar image leblanc_kevin  ( 2013-09-29 11:44:04 -0500 )edit

I must say I'll be glad when rosbuild is gone: one less degree of freedom. The ROS documentation and tools are lagging, and understandably. Too many tools need to do slightly different things in different ways for different cases... Going from Electric to Hydro has been an interesting experience.

leblanc_kevin gravatar image leblanc_kevin  ( 2013-09-29 11:50:03 -0500 )edit

Yes, it's a difficult migration. Once it's done, the catkin/bloom-only world works reasonably smoothly.

joq gravatar image joq  ( 2013-09-29 11:53:45 -0500 )edit

"Yes, rospack does only traverse the run dependencies" - Doesn't rospack depends list out all the ros dependencies of that package ( both build and run, from what I have checked using the package actionlib ) and only excludes the system dependencies?

sam26 gravatar image sam26  ( 2017-03-06 01:45:31 -0500 )edit

Question Tools

5 followers

Stats

Asked: 2013-09-28 17:07:05 -0500

Seen: 8,314 times

Last updated: Sep 28 '13