pythonrosrospy

ROS python Error "The manifest (with format version 2) must not contain the following tags: run_depend"


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="gtkratosman-lap@todo.todo">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>

Solution

  • 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="gtkratosman-lap@todo.todo">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>