Questions about package.xml

Could you please explain:

  1. the difference between <build_depend> and <build_export_depend>
  2. As I understand actionlib is needed to build .action messages and give action functionality. Is that correct? What is the difference in actionlib and actionlib_msgs
  3. when do I have to include std_msgs and nav_msgs etc. in the package.xml and when not?
  4. Do I not have to import std_msgs in my .py files if I have it in ***<exec_depend>***?

<build_depend>: It states the dependencies only needed for the compilation. Good if you only then will use a binary version of your package.
<build_export_depend>: If you have export headers, then this is also needed.
: Put this and it will take care of everything. The others are if you need to be more precise. I highly recommend these sources to know all about this topic, or at least have some idea.



actionlib: Is the library with all the related ROS actions systems.
actionlib_msgs: Are only related to the messages of actions, needed when creating the custom action messages.

You have to include them always that you use them in the C++/python scripts and/or custom messages.

If you only use them in execution, std_msgs just need to be addes as an ***<exec_depend>***. But if you dont want to complicate yourself, just put depend, as stated above.

Note that package.xml is meant to be used for having modular packages that are easily installed and that notify the user when they don’t have something installed. The Cmakelists.txt is what will crash everything if something is not added correctly. Package.xml is more to make the use fo your package easier.

Hope this helped. If you have further questions don’t hesitate to ask ;).

1 Like