6

I have been following the book "Programming Robots with ROS: A Practical Introduction to the Robot Operating System"

In the "Defining a New Message" part of the book we create a new message definition

Example 3-3. Complex.msg
float32 real
float32 imaginary

so we require to modify the package.xml and add the following lines:

<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend> 

but when I run the catkin_make in the catkin_ws directory I get the following error

Error(s) in /home/gtkratosman-lap/catkin_ws/src/basic/package.xml:
- The manifest (with format version 2) must not contain the following tags: run_depend

My version:

ii  python-rospkg                                         1.1.4-100                                           all          ROS package library
ii  python-rospkg-modules                                 1.1.4-1                                             all          ROS package library

Here is the full package.xml file

<?xml version="1.0"?>
<package format="2">
  <name>basic</name>
  <version>0.0.0</version>
  <description>The basic package</description>

  <maintainer email="[email protected]">gtkratosman-
  lap</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>


  <run_depend>message_generation</run_depend>
  <run_depend>message_runtime</run_depend>

  <build_export_depend>rospy</build_export_depend>
  <exec_depend>rospy</exec_depend>

  <export>
  </export>
</package>
2
  • I also had to make modifications to the CMakeLists.txt but I think those modifications are not relevant here Nov 15, 2017 at 14:26
  • As a side note: There is usually no need to put rospy as a build_depend, as Python code is not build anyway. Further message_generation should be a build_depend.
    – luator
    Nov 28, 2017 at 9:17

2 Answers 2

14

You are mixing formats 1 and 2 in your package.xml: <run_depend> is only available in format 1 while in format 2 it should be <exec_depend> (which is not available in format 1).

So in your case simply replace run_depend with exec_depend and it should be good.

For more information about the difference between the formats see the official documentation.

2
2

Just omit the format. It is not necessary and breaks your code. Use this template for your package.xml.

<?xml version="1.0"?>
<package>

    <name>basic</name>
    <version>0.0.0</version>
    <description>The basic package</description>

    <maintainer email="[email protected]">gtkratosman-lap</maintainer>

    <license>TODO</license>

    <buildtool_depend>catkin</buildtool_depend>
    <build_depend>rospy</build_depend>
    <build_depend>message_generation</build_depend>

    <run_depend>message_runtime</run_depend>

    <export>
    <!-- Other tools can request additional information be placed here -->
    </export>

2
  • 2
    When I omit the format, catkin_make defaults to version 1, which is even worse. - The manifest (with format version 1) must not contain the following tags: build_export_depend, exec_depend May 31, 2018 at 22:03
  • exec_depend is defined in manifest format version 2. If you want to use it, then use manifest format version 2.
    – maetulj
    Jun 1, 2018 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.