Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I write package.xml?

I came across several tutorials about catkin and especially the package.xml tutorial; I wonder how should I write the package.xml. Here is a simple example:

package.xml

<?xml version="1.0"?>
<package>
  <name>ensenso_n10_description</name>
  <version>0.0.0</version>
  <description>Ensenso end effector for Fanuc M10iA</description>
  <maintainer email="my_mail@gmail.com">Name</maintainer>
  <license>All rights reserved</license>

  <buildtool_depend>catkin</buildtool_depend>
<!--
  <run_depend>joint_state_publisher</run_depend>
  <run_depend>robot_state_publisher</run_depend>
  <run_depend>rviz</run_depend>
  <run_depend>xacro</run_depend>
-->
</package>

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(ensenso_n10_description)
find_package(catkin REQUIRED)

catkin_package()

foreach(dir launch meshes urdf)
  install(
    DIRECTORY ${dir}/
    DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach()

I was expecting things not work with the commented out section, but it turns out it works well without the run_depend tags. The full package can be viewed here.

I've manually written package.xml but I don't understand how I am supposed to fill the build_depend and run_depend tags.

  1. How do I check that my package.xml is correctly written? (I only know catkin_lint)
  2. In what cases would anything fail if the package.xml is wrong?
  3. Is there a tool that automatically writes the package.xml? (using the CMakeLists.txt for example). If it's not possible, why?
  4. Why is information duplicated between CMakeLists.txt and package.xml?

How do I write package.xml?

I came across several tutorials about catkin and especially the package.xml tutorial; I wonder how should I write the package.xml. Here is a simple example:

package.xml

<?xml version="1.0"?>
<package>
  <name>ensenso_n10_description</name>
  <version>0.0.0</version>
  <description>Ensenso end effector for Fanuc M10iA</description>
  <maintainer email="my_mail@gmail.com">Name</maintainer>
  <license>All rights reserved</license>

  <buildtool_depend>catkin</buildtool_depend>
<!--
  <run_depend>joint_state_publisher</run_depend>
  <run_depend>robot_state_publisher</run_depend>
  <run_depend>rviz</run_depend>
  <run_depend>xacro</run_depend>
-->
</package>

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(ensenso_n10_description)
find_package(catkin REQUIRED)

catkin_package()

foreach(dir launch meshes urdf)
  install(
    DIRECTORY ${dir}/
    DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach()

I was expecting things not to work with the commented out section, but it turns out it works well without the run_depend tags. The full package can be viewed here.

I've manually written package.xml but I don't understand how I am supposed to fill the build_depend and run_depend tags.

  1. How do I check that my package.xml is correctly written? (I only know catkin_lint)
  2. In what cases would anything fail if the package.xml is wrong?
  3. Is there a tool that automatically writes the package.xml? (using the CMakeLists.txt for example). If it's not possible, why?
  4. Why is information duplicated between CMakeLists.txt and package.xml?

How do I write package.xml?

I came across several tutorials about catkin and especially the package.xml tutorial; I wonder how should I write the package.xml. Here is a simple example:

package.xml

<?xml version="1.0"?>
<package>
  <name>ensenso_n10_description</name>
  <version>0.0.0</version>
  <description>Ensenso end effector for Fanuc M10iA</description>
  <maintainer email="my_mail@gmail.com">Name</maintainer>
  <license>All rights reserved</license>

  <buildtool_depend>catkin</buildtool_depend>
<!--
  <run_depend>joint_state_publisher</run_depend>
  <run_depend>robot_state_publisher</run_depend>
  <run_depend>rviz</run_depend>
  <run_depend>xacro</run_depend>
-->
</package>

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(ensenso_n10_description)
find_package(catkin REQUIRED)

catkin_package()

foreach(dir launch meshes urdf)
  install(
    DIRECTORY ${dir}/
    DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach()

I was expecting things not to work with the commented out section, but it turns out it works well without the run_depend tags. The full package can be viewed here.

I've manually written package.xml but I don't understand how I am supposed to fill the build_depend and run_depend tags.

  1. How do I check that my package.xml is correctly written? (I only know catkin_lint)
  2. In what cases would anything fail if the package.xml is wrong?
  3. Is there a tool that automatically writes the package.xml? (using the CMakeLists.txt for example). If it's not possible, why?
  4. Why is information duplicated between CMakeLists.txt and package.xml?